01Chapter 1: What a hash function doesThis chapter assumes you can read basic Python, and that you know what binary and hexadecimal notation are. You should also know what an array is and have used a dictionary (a map from keys to values). Bitwise operations and the modulo operator appear in later chapters, not in this one.2 min read
02Chapter 2: Why hash tables need hash functionsThis chapter assumes you can read basic Python, use the modulo operator, and know what a dictionary (a map from keys to values) does. It explains the job a hash function does inside a hash table.2 min read
03Chapter 3: What makes a hash good: determinism, uniformity, speedThis chapter assumes you can read Python, use the modulo operator, and know that a dictionary stores values in buckets. A hash function maps any input to a fixed-size number. Three properties decide whether a hash suits a hash table: determinism, uniformity, and speed.2 min read
04Chapter 4: Collisions are unavoidableThis chapter assumes you can read basic Python, know what a hash function is (a deterministic map from arbitrary input to a fixed-size value), and are comfortable with powers of two and the modulo operator. It covers why two different inputs must sometimes share a hash value, and why you should desi3 min read
05Chapter 5: From hash value to bucket indexThis chapter assumes you can read Python, use the % and & operators, and know that a hash table stores items in an array of buckets. It also assumes you know what a hash function returns for a key.2 min read
06Chapter 6: Bad hashes: summing characters and other trapsThis chapter assumes you know Python basics, bytes, and the modulo operator. You also need the earlier ideas that a hash function is deterministic and should spread keys evenly across buckets. Here you will see how a plausible-looking hash fails those goals.2 min read
07Chapter 7: Building a better hash: polynomial hashing and FNV-1aThis chapter assumes you know Python, hexadecimal, XOR, masks, and the modulo operator. You should also know why a hash table needs a function that spreads keys evenly. The previous chapter showed that summing character codes puts every anagram in the same bucket. Here you build two hashes that fix 2 min read
08Chapter 8: Measuring the avalanche effectThis chapter assumes you can read Python, understand XOR and binary notation, and know how a hash table maps a hash value to a bucket. Earlier chapters showed that a summing hash sends anagrams to the same bucket. Here you will measure how well a hash separates inputs that are almost identical.2 min read
09Chapter 9: How likely is a collision? The birthday boundThis chapter assumes you know that a hash function maps inputs to a fixed number of output bits, and that the pigeonhole principle forces collisions once there are more inputs than outputs. It also assumes you are comfortable with powers of two and basic Python.2 min read
10Chapter 10: Hash flooding attacks and seeded hashesThis chapter assumes you know how a hash table maps keys to buckets with a modulo, and that you have read the earlier chapters on collisions and bucket mapping.2 min read
11Chapter 11: What cryptographic hashes addThis chapter assumes you know what a hash function is, why collisions are unavoidable, and the birthday bound from the earlier chapters. You should also be comfortable reading short Python.2 min read
12Chapter 12: When a hash breaks: MD5 and SHA-1This chapter assumes you know the three cryptographic resistance properties (preimage, second-preimage, collision) and the birthday bound from earlier chapters. You should also be comfortable with Python's hashlib.2 min read
13Chapter 13: Using SHA-256 to check integrityThis chapter assumes you know what a hash function is, why collisions exist, and the three cryptographic resistance properties: preimage, second-preimage, and collision resistance. You should also be comfortable reading Python and hexadecimal.2 min read
14Chapter 14: Authenticating messages with HMACThis chapter assumes you know what SHA-256 does and why it is used for integrity checks. You should also be comfortable with bytes in Python.2 min read
15Chapter 15: Storing passwords: salts and slow hashesThis chapter assumes you know Python, bytes and hex notation, and the SHA-256 integrity check from the earlier chapter. It explains why a plain fast hash is the wrong tool for passwords and what to use instead.3 min read
16Chapter 16: Choosing a hash for the jobThis chapter assumes you know the earlier material: collisions, the birthday bound, avalanche, hash flooding, SHA-256, HMAC and salted password hashing. It turns them into a decision procedure.2 min read