Skip to main content
Version: v0.0.5

Function: dea()

dea(rng, person?): string

A synthetic DEA number - <registrant-type><initial> + 7 digits with a deliberately-invalid checksum, so it can never be a validly-issued DEA registration (a real DEA number's 7th digit satisfies the published DEA checksum). The first letter is a registrant-type letter, the second is derived from person (its family initial) when supplied so the number reads plausibly; the 6-digit base is seeded and the check digit is set to (correct + 1) mod 10, guaranteeing the value fails validation. NCPDP carries prescriber DEA, and this is the identity locus a refuter attacks hardest, so - like npi - non-collision is a construction-level guarantee, not a heuristic.

Parameters

rng

Rng

The seeded generator.

person?

SyntheticName

Optional name whose family initial becomes the DEA's second letter.

Returns

string

A DEA-shaped string that is provably not a real DEA registration.

Example

import { createRng, dea, isSyntheticDea } from "@cosyte/synth";
isSyntheticDea(dea(createRng(1))); // true - invalid checksum by construction