News for hackers. Stuff that matters.
Re:Multihash – self-describing hashes by panic on Sunday February 26, 2017 @05:13PM (#13740303)
What are you going to do with the hash after you trim off the metadata if you don't understand the format?
Re:Multihash – self-describing hashes by mtdewcmu on Sunday February 26, 2017 @06:52PM (#13740770)
I've dealt with variable-length headers on (binary) things before, and it creates annoyances. It screws up the memory alignment, for instance.
Re:Multihash – self-describing hashes by IanCal on Monday February 27, 2017 @02:47AM (#13742600)
I have two minor, but useful, uses:

One is that the prefix is probably unique for small sets. So it's both easy to read and parse and then use just a prefix for doing something like stopping a docker container.

Second is that a short prefix on a larger set of data is probably not unique but at a rate I can predict. I can take a random, and repeatable, sample of data by selecting everything with the same prefix. This gives me a fast way of taking a random sample from a database (or file or anything else).

Re:Multihash – self-describing hashes by mtdewcmu on Sunday February 26, 2017 @05:37PM (#13740428)
Good question. There are instances where it allows you to write cleaner (and faster) code if you can identify the parts without necessarily having to parse the metadata.