To understand why Narrative requires hashed identifiers rather than raw PII, see Data Pseudonymization.
Prerequisites
Before you begin, ensure you have:- Your ID list saved as a single-column CSV file
- Access to one of the following: Google Sheets, a command line terminal, or the Touchless PII Hasher app
Choose your method
Hashing email addresses
Pre-formatting requirements
Hash functions are case-sensitive and whitespace-sensitive. Before hashing, you must normalize your email addresses:Supported hash algorithms
Narrative supports three hash algorithms. For maximum correspondence with other datasets, we recommend generating all three:Method 1: Touchless PII Hasher (fastest)
The Touchless PII Hasher is a free web app that handles formatting and hashing automatically. Your data never leaves your browser.1
Open the app
Navigate to narrative.io/touchless-pii-hasher.
2
Upload your file
Drag and drop your CSV file or click to browse.
3
Download the results
The app automatically formats and hashes your data. Download the resulting file.
Method 2: Google Sheets (small lists)
For lists under 10,000 rows, use Narrative’s Hashing Functions spreadsheet which automatically handles pre-formatting and all three hash algorithms.1
Make a copy of the template
Open the Hashing Functions spreadsheet and click Make a copy when prompted.
2
Paste your email list
Copy your list of emails and paste them starting in cell A4.
3
Wait for processing
The spreadsheet may take a few minutes to compute, depending on list size.
4
Download the results
Navigate to the tab titled DOWNLOAD_THIS_SHEET_AS_.CSV_FILE. Go to File > Download > Comma-separated values (.csv, current sheet).
Method 3: Command line (large lists)
For large lists or automation, use the command line. Narrative provides a hashing script, or you can use standard Unix tools.- Mac/Linux
- Windows (PowerShell)
Option A: Use Narrative’s hashing scriptOption B: Use standard Unix toolsFor a quick one-liner that handles pre-formatting and generates SHA-256 hashes:To generate all three hash formats:
1
Download the script
Download hashingFunction.py and save it to your
~/bin directory.2
Make it executable
3
Run the script
Hashing phone numbers
Phone numbers follow a similar process, but with different pre-formatting rules.Pre-formatting requirements
Using Google Sheets for phone numbers
Use Narrative’s Phone Hashing Functions spreadsheet which automatically strips non-numeric characters before hashing. Follow the same steps as email hashing above.Using command line for phone numbers
- Mac/Linux
- Windows (PowerShell)
Verify your output
Before uploading, verify your hashing is correct using this test data: Test email:[email protected]
If your hashes match, your implementation is correct.
Uploading your hashed list
Once your list is hashed:- Ensure your file is in CSV format
- Navigate to your dataset in Narrative
- Upload the hashed file
Troubleshooting
Related content
Data Pseudonymization
Understand why Narrative requires hashed identifiers
Touchless PII Hasher
Free web app for quick, secure hashing
Security Model
Learn how Narrative protects your data

