4 ms·
This is really a walk through of the SHA-1 algorithm. It's also worthwhile to note that the statement that a hash takes a string and reduces it to a fixed leng
by stygiansonic 10y ago
This is really a walk through of the SHA-1 algorithm.
It's also worthwhile to note that the statement that a hash takes a string and reduces it to a fixed length string is a little misleading. They really work at the binary level and this is seen in the example where the input is converted to binary assuming ASCII and the output hex encoded.
- A_Crazy_Idea 10y agoThis is really a test of ycombinator users.
- Ar-Curunir 10y agoyou could easily define hash functions that work over A..Z if you wanted; there's nothing special about that. The misleading part is about the reduction to a unique fixed length string; that's not possible unless the input domain is equal to (or smaller than) the output domain (and even then it's not necessary). Any other function is guaranteed to have collisions.