UNPKG

@konfirm/iso13616

Version:

ISO 13616-1:2007 - International Bank Account Number

1 lines 26 kB
{"version":3,"file":"main.min.mjs","sources":["../../node_modules/@konfirm/iso7064/dist/esm/main.mjs","../../source/Entity/Mod97_10.ts","../../source/Entity/ISO13616.ts"],"sourcesContent":["/**\n * Simple type detection\n *\n * @param {*} input\n * @return {string} type\n */\nfunction type(input) {\n return input === null ? 'null' : Array.isArray(input) ? 'array' : typeof input;\n}\n\n/**\n * Error thrown if an Alphabet receives less characters than needed\n *\n * @class InvalidInputError\n * @extends {Error}\n */\nlet InvalidInputError$1 = class InvalidInputError extends Error {\n /**\n * Creates an instance of InvalidInputError\n *\n * @memberof InvalidInputError\n */\n constructor(source) {\n super(`Alphabets requires a string(able), got (${type(source)}) ${source}`);\n const { constructor, constructor: { name } } = this;\n this.name = name;\n Error.captureStackTrace(this, constructor);\n }\n};\n\n/**\n * Error thrown if an Alphabet receives duplicate characters\n *\n * @class DuplicateCharacterError\n * @extends {Error}\n */\nlet DuplicateCharacterError$1 = class DuplicateCharacterError extends Error {\n /**\n * Creates an instance of DuplicateCharacterError\n *\n * @param {object} [meta={source, duplicate}]\n * @memberof DuplicateCharacterError\n */\n constructor(source, duplicate) {\n super(`Alphabets cannot contain duplicate characters, found \"${duplicate}\" in \"${source}\"`);\n const { constructor, constructor: { name } } = this;\n this.name = name;\n Error.captureStackTrace(this, constructor);\n }\n};\n\nconst storage$1 = new WeakMap();\nconst defaultCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\nconst stringable = (input) => /string|object/.test(type(input));\n/**\n * Immutable alphabet\n *\n * @class Alphabet\n */\nclass Alphabet {\n constructor(source = defaultCharacters) {\n const characters = stringable(source) ? String(source) : '';\n const alphabet = Array.from(characters);\n const duplicate = alphabet.filter((v, i, a) => a.indexOf(v) !== i).join('');\n if (!characters.length) {\n throw new InvalidInputError$1(source);\n }\n if (duplicate.length) {\n throw new DuplicateCharacterError$1(characters, duplicate);\n }\n storage$1.set(this, { characters, alphabet });\n }\n /**\n * Obtain the configured characters\n *\n * @readonly\n * @memberof Alphabet\n */\n get characters() {\n const { characters } = storage$1.get(this);\n return characters;\n }\n /**\n * Get the number of bytes of the alphabet\n *\n * @readonly\n * @memberof Alphabet\n */\n get byteLength() {\n return this.characters.length;\n }\n /**\n * Get the character length of the alphabet\n *\n * @readonly\n * @memberof Alphabet\n */\n get length() {\n const { alphabet: { length } } = storage$1.get(this);\n return length;\n }\n /**\n * Extract part of the alphabet and return it as a (singleton) instance of alphabet\n *\n * @param {number} start\n * @param {number} end\n * @returns {Alphabet} instance\n * @memberof Alphabet\n */\n slice(start, end) {\n const { alphabet } = storage$1.get(this);\n const { constructor: Ctor } = Object.getPrototypeOf(this);\n return Ctor.from(alphabet.slice(start, end).join(''));\n }\n /**\n * Get the character at given index\n *\n * @param {number} index\n * @returns {string} char\n * @memberof Alphabet\n */\n charAt(index) {\n const { alphabet } = storage$1.get(this);\n return alphabet[index];\n }\n /**\n * Get the character code at given index\n *\n * @param {numer} index\n * @returns {number} charcode\n * @memberof Alphabet\n */\n charCodeAt(index) {\n const { characters, length } = this;\n return index >= 0 && index < length ? characters.charCodeAt(index) : undefined;\n }\n /**\n * Get the code point at given index\n *\n * @param {numer} index\n * @returns {number} codepoint\n * @memberof Alphabet\n */\n codePointAt(index) {\n const char = this.charAt(index);\n return char ? char.codePointAt(0) : undefined;\n }\n /**\n * Get the index of the given character\n *\n * @param {string} char\n * @returns {number} index\n * @memberof Alphabet\n */\n indexOf(char) {\n const { alphabet } = storage$1.get(this);\n return alphabet.indexOf(char);\n }\n /**\n * Map any amount of indices to the corresponding characters (wrapping the\n * indices around if they exceed the length of the alphabet)\n *\n * @param {number} ...list\n * @returns {string} [char]\n * @memberof Alphabet\n */\n map(...list) {\n const { length } = this;\n const normal = (index) => index < 0 ? normal(length + index) : index;\n return list.map((index) => this.charAt(normal(index) % length));\n }\n /**\n * Convert the Alphabet into a string\n *\n * @returns {string} chars\n * @memberof Alphabet\n */\n toString() {\n return this.characters;\n }\n /**\n * Ensure the Alphabet is properly JSON-stringified\n *\n * @returns\n * @memberof Alphabet\n */\n toJSON() {\n return String(this);\n }\n /**\n * Obtain a singleton instance of Alphabet representing the provided characters\n *\n * @static\n * @param {*} characters\n * @returns\n * @memberof Alphabet\n */\n static from(characters) {\n if (!storage$1.has(this)) {\n storage$1.set(this, new Map());\n }\n const map = storage$1.get(this);\n if (!map.has(characters)) {\n map.set(characters, new this(characters));\n }\n return map.get(characters);\n }\n}\n\nconst storage = new WeakMap();\n/**\n * Implement the common ISO 7064 implementation mechanics\n *\n * @class ISO7064\n */\nclass ISO7064 {\n constructor(options = {}) {\n storage.set(this, options);\n }\n /**\n * The algorithm name\n *\n * @readonly\n * @memberof ISO7064\n */\n get algorithm() {\n const { algorithm } = storage.get(this);\n return algorithm || 'Custom';\n }\n /**\n * The specification name\n *\n * @readonly\n * @memberof ISO7064\n */\n get specification() {\n const { algorithm } = this;\n return `ISO 7064, ${algorithm}`;\n }\n /**\n * The designation (always 0, except for the Modulus implementations)\n *\n * @readonly\n * @memberof ISO7064\n */\n get designation() {\n const { designation } = storage.get(this);\n return designation || 0;\n }\n /**\n * The alphabet of allowed characters and from which to obtain the indices\n *\n * @readonly\n * @memberof ISO7064\n */\n get indices() {\n const { indices, alphabet } = storage.get(this);\n return indices || alphabet;\n }\n /**\n * The checksum alphabet\n *\n * @readonly\n * @memberof ISO7064\n */\n get alphabet() {\n const { alphabet } = storage.get(this);\n return alphabet;\n }\n /**\n * The modulus\n *\n * @readonly\n * @memberof ISO7064\n */\n get modulus() {\n const { modulus, alphabet } = storage.get(this);\n return modulus || (alphabet && alphabet.length);\n }\n /**\n * The radix\n *\n * @readonly\n * @memberof ISO7064\n */\n get radix() {\n const { radix } = storage.get(this);\n return radix;\n }\n /**\n * Does the checksum consist of double digits\n *\n * @readonly\n * @memberof ISO7064\n */\n get double() {\n const { double } = storage.get(this);\n return double || false;\n }\n /**\n * Normalize input, removing any character not allowed in the input\n *\n * @param {string} input\n * @returns {string} normalized\n * @memberof ISO7064\n */\n normalize(input) {\n const { indices = 'a-zA-Z0-9' } = this;\n const purge = new RegExp(`[^${indices}]+`, 'g');\n return String(input)\n .toUpperCase()\n .replace(purge, '');\n }\n /**\n * Calculate the checksum for input\n *\n * @param {string} input\n * @returns {string} checksum\n * @memberof ISO7064\n */\n checksum(input) {\n throw new Error('Checksum method not implemented');\n }\n /**\n * Validate the input\n *\n * @param {string} input\n * @returns {boolean} valid\n * @memberof ISO7064\n */\n validate(input) {\n const { indices, alphabet, double } = this;\n const pattern = new RegExp(`([${indices}]+)([${alphabet}]{${Number(double) + 1}})`);\n const match = this.normalize(input).match(pattern);\n if (match) {\n const [, num, cc] = match;\n return this.checksum(num) === cc;\n }\n return false;\n }\n /**\n * Generate the normalized output including the checksum\n *\n * @param {string} input\n * @returns {string} generated\n * @memberof ISO7064\n */\n generate(input) {\n const normal = this.normalize(input);\n return `${normal}${this.checksum(input)}`;\n }\n /**\n * Create a new instance based on the current settings with optional overrides\n *\n * @param {object} options\n * @returns\n * @memberof ISO7064\n */\n factory(options = {}) {\n const { indices, alphabet, modulus, radix, double } = this;\n const { constructor: Ctor } = Object.getPrototypeOf(this);\n return new Ctor(Object.assign({ indices,\n alphabet,\n modulus,\n radix,\n double }, options));\n }\n}\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\n/**\n * Pure checksum calculation implementation\n *\n * @class PureISO7064\n * @extends {ISO7064}\n */\nclass PureISO7064 extends ISO7064 {\n /**\n * Creates an instance of PureISO7064\n *\n * @param {*} options\n * @memberof PureISO7064\n */\n constructor(options = {}) {\n const { alphabet, radix = 2, indices = alphabet === null || alphabet === void 0 ? void 0 : alphabet.slice(0, -1) } = options, rest = __rest(options, [\"alphabet\", \"radix\", \"indices\"]);\n super(Object.assign({ alphabet, indices, radix }, rest));\n }\n /**\n * Calculate the checksum for input\n *\n * @param {string} input\n * @returns {string} checksum\n * @memberof PureISO7064\n */\n checksum(input) {\n const { modulus, radix, double, indices, alphabet } = this;\n const initial = alphabet.charAt(0).repeat(Number(double) + 1);\n const normal = this.normalize(input) + initial;\n const sum = Array.from(normal)\n .map((char) => indices.indexOf(char))\n .reduce((carry, pos) => (carry * radix + pos) % modulus, 0);\n const checksum = (modulus + 1 - (sum % modulus)) % modulus;\n return (double\n ? [(checksum / radix) | 0, checksum % radix]\n : [checksum])\n .map((index) => alphabet.charAt(index))\n .join('');\n }\n}\n\n/**\n * Hybrid checksum calculation implementation\n *\n * @class HybridISO7064\n * @extends {ISO7064}\n */\nclass HybridISO7064 extends ISO7064 {\n /**\n * Calculate the checksum for input\n *\n * @param {string} input\n * @returns {string} checksum\n * @memberof HybridISO7064\n */\n checksum(input) {\n const { modulus: mod, indices, alphabet } = this;\n const sum = Array.from(this.normalize(input))\n .map((char) => indices.indexOf(char))\n .reduce((carry, pos) => (((carry % (mod + 1)) + pos) % mod || mod) * 2, mod) % (mod + 1);\n return alphabet.charAt((mod + 1 - sum) % mod);\n }\n}\n\nconst alphabet = {\n num: Alphabet.from('0123456789'),\n numX: Alphabet.from('0123456789X'),\n alpha: Alphabet.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),\n alphanum: Alphabet.from('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'),\n alphanumA: Alphabet.from('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*')\n};\nconst Mod11_2 = new PureISO7064({\n algorithm: 'MOD 11-2',\n designation: 1,\n alphabet: alphabet.numX\n});\nconst Mod37_2 = new PureISO7064({\n algorithm: 'MOD 37-2',\n designation: 2,\n alphabet: alphabet.alphanumA\n});\nconst Mod97_10 = new PureISO7064({\n algorithm: 'MOD 97-10',\n designation: 3,\n modulus: 97,\n radix: 10,\n alphabet: alphabet.num,\n indices: alphabet.num,\n double: true\n});\nconst Mod661_26 = new PureISO7064({\n algorithm: 'MOD 661-26',\n designation: 4,\n modulus: 661,\n radix: 26,\n alphabet: alphabet.alpha,\n indices: alphabet.alpha,\n double: true\n});\nconst Mod1271_36 = new PureISO7064({\n algorithm: 'MOD 1271-36',\n designation: 5,\n modulus: 1271,\n radix: 36,\n alphabet: alphabet.alphanumA,\n double: true\n});\nconst Mod11_10 = new HybridISO7064({\n algorithm: 'MOD 11,10',\n designation: 6,\n alphabet: alphabet.num\n});\nconst Mod27_26 = new HybridISO7064({\n algorithm: 'MOD 27,26',\n designation: 7,\n alphabet: alphabet.alpha\n});\nconst Mod37_36 = new HybridISO7064({\n algorithm: 'MOD 37,36',\n designation: 8,\n alphabet: alphabet.alphanum\n});\n\nexport { Alphabet, HybridISO7064, ISO7064, Mod11_10, Mod11_2, Mod1271_36, Mod27_26, Mod37_2, Mod37_36, Mod661_26, Mod97_10, PureISO7064 };\n//# sourceMappingURL=main.mjs.map\n","import { Mod97_10, Alphabet } from '@konfirm/iso7064';\n\n/**\n * Extension of the ISO7064 MOD 97-10 Algorithm\n */\nexport const CustomMod97_10 = Mod97_10.factory({\n\talgorithm: 'MOD 97-10 (Custom)',\n\tdesignation: 3,\n\tindices: Alphabet.from('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'),\n});\n","import { CustomMod97_10 } from './Mod97_10';\n\nexport type ISO13616Match = {\n\tcountry: string;\n\tchecksum: string;\n\taccount: string;\n};\n\n/**\n * Validate the input to satisfy the ISO 13616 checksum\n *\n * @static\n * @param {string|number} input\n * @returns {boolean} valid\n * @memberof ISO13616\n */\nexport function validate(input: string): boolean {\n\tconst { country, checksum: check, account } = match(String(input));\n\n\treturn checksum(account, country) === check;\n}\n\n/**\n * Calculate the ISO 13616 checksum\n *\n * @static\n * @param {string} account\n * @param {string} country ISO 3166 code\n * @returns {string} checksum\n * @memberof ISO13616\n */\nexport function checksum(account: string, country: string): string {\n\tconst { modulus, indices } = CustomMod97_10;\n\tconst numeric = Array.from(`${account}${country}`)\n\t\t.map((char) => indices.indexOf(char))\n\t\t.filter((value) => value >= 0)\n\t\t.join('');\n\tconst checksum = CustomMod97_10.checksum(numeric);\n\tconst number = Number(checksum);\n\n\t// ISO13616-1:2020 states: the check digits can only be in the range [02..98]\n\treturn number <= 98 - modulus ? String(number + modulus) : checksum;\n}\n\n/**\n * Generate the full ISO 13616 string, including the checksum\n *\n * @static\n * @param {string} account\n * @param {string} country\n * @param {boolean} formatting (in pairs of 4)\n * @returns {string} generated ISO 13616\n * @memberof ISO13616\n */\nexport function generate(account: string, country: string, formatting: boolean = false): string {\n\tconst generated = `${country}${checksum(account, country)}${account}`;\n\n\treturn formatting ? format(generated) : CustomMod97_10.normalize(generated);\n}\n\n/**\n * Format the input to match the specified groups of 4 characters\n *\n * @static\n * @param {string|number} input\n * @returns {string} formatted\n * @memberof ISO13616\n */\nexport function format(input: string | number): string {\n\tconst normal: string = CustomMod97_10.normalize(String(input));\n\n\treturn Array.from(normal)\n\t\t.reduce(\n\t\t\t(carry, char, index) =>\n\t\t\t\tcarry + (index && index % 4 === 0 ? ' ' : '') + char,\n\t\t\t''\n\t\t);\n}\n\n/**\n * Match the input and return the matches values as object\n *\n * @static\n * @param {string} input\n * @returns {ISO13616Match}\n * @memberof ISO13616\n */\nexport function match(input: string): ISO13616Match {\n\tconst [, country, checksum, account] =\n\t\tCustomMod97_10.normalize(input).match(\n\t\t\t/^([A-Z]{2})([0-9]{2})(\\w{1,30})$/\n\t\t) || [];\n\n\treturn { country, checksum, account };\n}\n"],"names":["type","input","Array","isArray","InvalidInputError$1","Error","constructor","source","super","name","this","captureStackTrace","DuplicateCharacterError$1","duplicate","storage$1","WeakMap","Alphabet","characters","test","String","alphabet","from","filter","v","i","a","indexOf","join","length","set","get","byteLength","slice","start","end","Ctor","Object","getPrototypeOf","charAt","index","charCodeAt","undefined","codePointAt","char","map","list","normal","toString","toJSON","has","Map","storage","ISO7064","options","algorithm","specification","designation","indices","modulus","radix","double","normalize","purge","RegExp","toUpperCase","replace","checksum","validate","pattern","Number","match","num","cc","generate","factory","assign","SuppressedError","PureISO7064","rest","s","e","t","p","prototype","hasOwnProperty","call","getOwnPropertySymbols","propertyIsEnumerable","__rest","initial","repeat","sum","reduce","carry","pos","HybridISO7064","mod","numX","alpha","alphanum","alphanumA","Mod97_10","CustomMod97_10","country","check","account","numeric","value","number","formatting","generated","format"],"mappings":"AAMA,SAASA,EAAKC,GACV,OAAiB,OAAVA,EAAiB,OAASC,MAAMC,QAAQF,GAAS,eAAiBA,CAC7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