Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

A simple NHS number validator for Node and browsers

License

Notifications You must be signed in to change notification settings

tbrd/nhs-numbers

 
 

Repository files navigation

NHS numbers

A simple NHS number generator & validator, following the process described in the NHS Data Dictionary.

Based on https://github.com/spikeheap/nhs-number-validator

Installation

yarn add nhs-numbers

Usage

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")

Contributing

Setup

yarn

Test

yarn test

About

A simple NHS number validator for Node and browsers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 95.6%
  • JavaScript 4.4%