liveBook · Manning

Hash value

As explained in Effective Data Analysis

A hash code is the fixed-size output produced by applying a hash function to data.

A hash value is the fixed-size output produced when a hash function transforms data. Deterministic hashing gives repeated inputs the same value, allowing a hash to serve as a pseudonymous identifier for joining records without exposing the original field. section 8.3.2

Use hash values with these boundaries in mind:

  • Treat the value as an identifier, not as a measure of similarity: small changes in the original data produce very different hashes. section 8.3.2
  • Keep the original sensitive data in a separate, restricted table while exposing only the hash in the analytics table. section 8.3.2
  • Do not assume reversal is permanently impossible; review current information-security practices before relying on hashing for protection. section 8.3.2

Hashing email addresses in pandas

Use Python’s hashlib library and SHA-256 to create an email_hash column, then save the original email and hash separately and remove email from the transactions table. section 8.3.2

How Effective Data Analysis covers it

How deep it goes
Explains deterministic behavior, sensitivity to small input changes, and security limits, then demonstrates a pandas implementation.
Examples
Demonstrates hashed email values in a transactions dataframe and separates original emails into a restricted table.
What it assumes
Assumes familiarity with sensitive data and dataframes while defining hashing and pseudonymization directly.
What you can do after
Apply hashing via Python’s hashlib library to pseudonymize sensitive fields and preserve cross-source joins.
How it connects
Connects hashing with pseudonymization, anonymization, primary keys, data warehouses, sensitive data, and access restriction.

Also explained in

Compare how 7 books explain hash value →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Data Analysis. The section links point to the parts of the book it draws on.