Questions about the id generation for links

5 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Itay Shakury

belum dibaca,
22 Jun 2015, 07.30.1522/06/15
kepadabookie_b...@googlegroups.com
Hello, I have only recently discovered Bookie and I have started browsing the code, Very cool project!
I have a question:
From what I understand, links are stored in a DB where the primary key is the first 14 characters of the sha256 of the URL. (Please correct me if I'm wrong in my understanding, only starting to get around the codebase).
I am interested, how unique is that key? Why can't we save the entire hash (i don't think the extra few bytes per record will make a significant difference)?
Just to clarify - this is a pure question, not a bug\feature suggestion. 
Thanks,
Itay

Richard Harding

belum dibaca,
22 Jun 2015, 08.13.0322/06/15
kepadabookie_b...@googlegroups.com
Hello Itay, the bookmark primary key is the bid field in the bmarks table.
This is a unique value for every bookmark. Bookie keeps urls in their own
table and generates a hash_id field that is used to map a bookmark to a
url. In this way, we can tell how many folks have bookmarked a distinct
url, even though they each have their own bookmark recorded with their own
list of tags, description, etc.

This means that we're expecting users to collide on the hash of the sha'd
url. It's by design.


--

Rick Harding
@mitechie
http://blog.mitechie.com
https://bmark.us
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru