SHA-256 is a Secure Hash Algorithm 2 function that converts an input, such as an email address, into a fixed 256-bit hash. Identical inputs produce identical hashes, while small input changes produce very different outputs. section 8.3.2
Use SHA-256 to:
- Replace sensitive identifiers with consistent hash values that can serve as analytics keys. section 8.3.2
- Keep original personally identifiable information in a separate, access-restricted table while analytics tables retain only hashes. section 8.3.2
- Link a new data source by hashing its shared identifier and joining on the resulting value. section 8.3.2
Hashing email addresses in pandas
Use Python’s standard hashlib library: define a function that encodes an email, applies hashlib.sha256, returns hexdigest(), and apply it to create an email_hash column.



