Skip to content

smvrnn/vgscode

Repository files navigation

VGSCode

Validate Generate Sanitize Code

List of supported codes:

*. Contributions are welcome

  1. Kazakhstan: IIN, BIN
  2. ...

Install

npm install vgscode

pnpm install vgscode

Usage ES6

import vgscode from "vgscode";

Usage Legacy

const vgscode = require("vgscode");

Example

validate

vgscode.vBIN("320243026191"); //true
vgscode.vIIN("320229474023"); //false

generate

vgscode.gBIN("320243"); //320243952485
vgscode.gIIN("320229"); //320229980830

sanitize

vgscode.sNumberToString(320229474021); //320229474021
vgscode.sTrimStart("  320229474021"); //320229474021
vgscode.sTrimEnd("320229474021   "); //320229474021
vgscode.sTrimBoth("  320229474021  "); //320229474021
vgscode.sTrimAll("32 0229  4740 21"); //320229474021
vgscode.sRemoveNonDigits("320#%2294 74fwef021"); //320229474021