A simple NHS number generator & validator, following the process described in the NHS Data Dictionary.
Based on https://github.com/spikeheap/nhs-number-validator
yarn add nhs-numbers
import {
generateNhsNumber,
generateInvalidNhsNumbers,
generateValidNhsNumbers,
validateNhsNumber
} from "nhs-numbers"
// generate
const nhsNumber = generateNhsNumber()
const validNhsNumbers = generateValidNhsNumbers(10)
const invalidNhsNumbers = generateInvalidNhsNumbers(10)
// validate
const result = validateNhsNumber("1234567880")
yarn
yarn test