-1

I have been trying up with random number generators in php to generate keys for photos structure on the website I am building. I recently came to know that Facebook as well as Instagram fit there photo ids in 64 bit.

Facebook Engineering Note -: http://www.facebook.com/note.php?note_id=76191543919 Instagram Engineering Note -: http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram

Just wanna know how these guys do it and fit various aspects like user id, timestamp in various bits to come up with 64 bits in total.

Any help would be greatly appreciated

Andrew Eisenberg
  • 117
  • 1
  • 1
  • 7
  • Just generate an id and test, whether it exists, or not. Which problem do you have? – KingCrunch Jan 06 '13 at 00:45
  • use IDs just like they do and then add padding , by the way facebook do padding in new user Ids you'll find new user ids like this : 10001231231231 100023543455 .....etc – Shehabic Jan 06 '13 at 00:51
  • You interpreted it wrong. I need to know just this "How do I fit a 60 character long random number in 41 bits". Just answer this man! – Andrew Eisenberg Jan 06 '13 at 00:54
  • 3
    @HaniffKumarMehta, demanding things from us will just get your question ignored. – kittycat Jan 06 '13 at 02:12

1 Answers1

0

Try looking at this:

64 bit key

Now just replace random counter with current timestamp.

Community
  • 1
  • 1
ROY Finley
  • 1,406
  • 1
  • 9
  • 18