سؤال

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

هل كانت مفيدة؟

المحلول

Try looking at this:

64 bit key

Now just replace random counter with current timestamp.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top