Skip to main content
All personally identifiable information (PII) uploaded to Narrative must be pseudonymized using cryptographic hash functions. This guide walks you through formatting and hashing email addresses and phone numbers before uploading them to the platform.
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:
Skipping pre-formatting will result in different hash values, preventing matches with other datasets. A single extra space or uppercase letter produces a completely different hash.

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

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.
Option A: Use Narrative’s hashing script
1

Download the script

Download hashingFunction.py and save it to your ~/bin directory.
2

Make it executable

3

Run the script

Option B: Use standard Unix toolsFor a quick one-liner that handles pre-formatting and generates SHA-256 hashes:
To generate all three hash formats:
Never direct output to the same file as input. This will delete your data:

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


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:
  1. Ensure your file is in CSV format
  2. Navigate to your dataset in Narrative
  3. Upload the hashed file

Troubleshooting


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