Euro banknote serialnumber
ZERO DEPENDENCIES
This module will verify/validate that a given serial number is a valid Euro banknote serial number.
The list of allowed country codes (and corresponding checksum digits) can be found in this wikipedia page.
I converted this to javascript from an old C assignment I did at university, see /old_c/checksum.c
.
Install
To use in a node application:
npm install euro-banknote-serialnumber
To use as a cli tool
npm install -g euro-banknote-serialnumber
Usage
In a node application:
const euroBanknoteSN = const check1 = euroBanknoteSN// check1 === false (it's invalid) const check2 = euroBanknoteSN// check2 === true (it's a valid series 1 banknote serial number) const check3 = euroBanknoteSN// check3 === true (it's a valid series 2 banknote serial number)
As a cli tool:
euro-banknote-serialnumber --helpeuro-banknote-serialnumber -heuro-banknote-serialnumber# outputs help about the command euro-banknote-serialnumber --verify L25388049086# outputs 'invalid' and return code is 1 (so you can use it in pipes) euro-banknote-serialnumber --verify X30284111711# outputs 'valid: X30284111711' and return code 0 (so you can use it in pipes) euro-banknote-serialnumber --verify NA4532489209# outputs 'valid: NA4532489209' and return code 0 (so you can use it in pipes)
License
MIT