Hashing turns a key of almost any size into an index that fits inside a bounded table. The compression step is where that shrinking actually happens, and this topic surveys the family of techniques that go beyond simple modular arithmetic. Folding methods split a key into equal-sized segments — digits, bytes, or bit groups — and combine those segments, usually by addition, so that every part of the key influences the final index. Shift folding adds the pieces as they are; boundary folding reverses alternating pieces before adding, which helps when neighboring keys differ only in position-sensitive ways.
Two other classic strategies round out the picture. Digit extraction selects only certain positions from the key, discarding digits that carry little variation (such as a shared prefix in student IDs). The mid-square method squares the key and extracts the middle digits, relying on the fact that the middle of a product depends on nearly all digits of the original. Each approach trades off differently among speed, distribution quality, and how much you need to know about your key population in advance.
The videos below build the surrounding context you need to evaluate these techniques. As you watch, keep three questions in mind: does every bit or digit of the key influence the output, how cheap is the operation to compute, and what assumptions about the key distribution does the method quietly make? Those same three questions are how you will compare folding, digit extraction, mid-square, and multiplicative or modular hashing later in the module.
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.