Page 99 - Data Structures Handout_Neat
P. 99
Example: Multiplication Method in C++
The multiplication method often produces a more uniform distribution than simple division,
especially when the constant is chosen carefully (commonly derived from the golden ratio).
9.2.3 Cryptographic Hash Functions (MD5, SHA)
Cryptographic hash functions are designed for security rather than efficiency in hash
tables. They produce fixed-size outputs that are practically impossible to reverse. These
functions are used in password storage, digital signatures, and blockchain technology.
Properties of cryptographic hash functions:
• Pre-image resistance: Hard to reconstruct the input from the output.
• Collision resistance: Hard to find two different inputs with the same output.
• Avalanche effect: Small input changes produce drastically different outputs.
(Here we keep the explanation theoretically since you requested only C++ examples
and no Python. Cryptographic libraries in C++ such as OpenSSL can be used for SHA or MD5,
but the code is more advanced and library dependent.)
99

