@konfirm/iso13616
Version:
ISO 13616-1:2007 - International Bank Account Number
56 lines (54 loc) • 1.4 kB
TypeScript
type ISO13616Match = {
country: string;
checksum: string;
account: string;
};
/**
* Validate the input to satisfy the ISO 13616 checksum
*
* @static
* @param {string|number} input
* @returns {boolean} valid
* @memberof ISO13616
*/
declare function validate(input: string): boolean;
/**
* Calculate the ISO 13616 checksum
*
* @static
* @param {string} account
* @param {string} country ISO 3166 code
* @returns {string} checksum
* @memberof ISO13616
*/
declare function checksum(account: string, country: string): string;
/**
* Generate the full ISO 13616 string, including the checksum
*
* @static
* @param {string} account
* @param {string} country
* @param {boolean} formatting (in pairs of 4)
* @returns {string} generated ISO 13616
* @memberof ISO13616
*/
declare function generate(account: string, country: string, formatting?: boolean): string;
/**
* Format the input to match the specified groups of 4 characters
*
* @static
* @param {string|number} input
* @returns {string} formatted
* @memberof ISO13616
*/
declare function format(input: string | number): string;
/**
* Match the input and return the matches values as object
*
* @static
* @param {string} input
* @returns {ISO13616Match}
* @memberof ISO13616
*/
declare function match(input: string): ISO13616Match;
export { type ISO13616Match, checksum, format, generate, match, validate };