hexdigest
A hash result written as a string of hexadecimal characters, returned by the hexdigest() method of a hashlib object.
In more detail
Each hexadecimal character stands for four bits, so a SHA-256 hexdigest is 64 characters long. Taking the first few characters gives a short but still well-spread identifier. Converting it with int(digest, 16) turns it into a large integer you can reduce modulo a table size.
Related terms
- hashlib — The Python standard-library module that computes stable cryptographic hashes such as SHA-256.
- SHA-256 — A widely used hash function that turns any data into a 256-bit fingerprint, shown as 64 hexadecimal characters.
- hexadecimal — A way of writing numbers with sixteen digits, 0 to 9 and then a to f, so each character stands for four bits.
Taught in
- What A Hash Function Promises — Algorithms & Data Structures for Working Engineers