This tool generates a deterministic, de-identified 10-digit numeric patient ID from a patient's name. The same name and salt will always produce the same ID, but the ID cannot be reversed back to the name.
You provide three things for each patient: their last name, first name, and optionally their middle name. You also provide a salt, a secret string that acts as a password for the ID generation.
The three name fields are combined into a single string in the format:
Last, First MiddleIf no middle name is provided, it becomes simply:
Last, FirstBefore assembly, each field is cleaned up: leading and trailing spaces are removed, and any runs of multiple spaces within a field are collapsed down to a single space. This means " Jane " and "Jane" produce the same result.
The assembled name string then has all whitespace and all commas stripped out entirely. For example:
Smith, Jane MarieSmithJaneMarieThis is important: case is preserved and matters. Smith and smith will produce different IDs. Hyphens in names (like Davis-Jones) are also preserved and included in the hash.
The secret salt string is placed before the cleaned name. If your salt is MySecret and the cleaned name is SmithJaneMarie, the string that gets hashed is:
MySecretSmithJaneMarieThe salt is used exactly as you type it. It is case-sensitive, and spaces within the salt are preserved. Everyone generating IDs for the same study must use the exact same salt to get matching IDs.
The combined string is fed into the SHA-256 cryptographic hash function. This produces a 64-character hexadecimal string (256 bits). SHA-256 is a one-way function. You cannot reverse the hash to recover the original name.
The hex output is then converted into a very large integer (up to 78 digits long).
The first 10 digits of that integer are taken as the patient ID. This is a simple string slice of the number: no rounding or math, just the leftmost 10 digits.
1079502049865113190095...1079502049All processing happens entirely in your browser using the Web Crypto API. No patient names, no salt, and no generated IDs are ever sent to a server. Nothing is stored after you close or refresh the page.