Function: deaCheckDigit()
deaCheckDigit(
base6):number
The correct DEA check digit for a 7-digit numeric base. The published DEA checksum is
(d1 + d3 + d5) + 2·(d2 + d4 + d6), whose units digit is the 7th (check) digit. A real DEA
number satisfies this; a number whose 7th digit differs cannot be a validly-issued DEA registration.
Parameters
base6
string
The first 6 digits of the DEA number (positions 1–6).
Returns
number
The check digit (0–9) a real DEA number would carry for this base.
Example
import { deaCheckDigit } from "@cosyte/synth";
deaCheckDigit("123456"); // the units digit of (1+3+5) + 2·(2+4+6)