Skip to main content
Version: v0.0.5

Variable: safe

const safe: Readonly<{ address: (rng) => SyntheticAddress; dateYmd: (rng, minYear, maxYear) => string; dea: (rng, person?) => string; email: (rng, person?) => string; identifier: (rng, typeCode) => SyntheticIdentifier; ipv4: (rng) => string; ipv6: (rng) => string; name: (rng) => SyntheticName; npi: (rng) => string; phone: (rng) => string; ssn: (rng, block) => string; uuid: (rng) => string; }>

The synthetic-safety provider namespace. Every function draws only from a reserved range or the shipped fake-name pool - no value it returns can be real or plausibly-real PHI.

Example

import { createRng, safe } from "@cosyte/synth";
const rng = createRng(42);
safe.ssn(rng); // never-issued SSN
safe.phone(rng); // reserved 555-01NN number