UNPKG

@halloverden/number-utilities-ts

Version:

Typescript library with utility functions for a bunch of numbers

23 lines (22 loc) 787 B
/** * Calculates a single control digit from the given input * * @param input * @param weights * @param acceptedRemainders Which remainders will be returned as is * @param onRemainder1 What to return if remainder is 1 * * @return string */ export declare function getMod11ControlDigit(input: string, weights: number[], acceptedRemainders?: number[], onRemainder1?: string): string; /** * Runs the getMod11ControlDigit the given number of times, and returns an array of control digits * * @param input * @param numberOfDigits * @param throwIfOne * * @return number[] */ export declare function getMod11ControlDigits(input: string, numberOfDigits: number, throwIfOne?: boolean): string[]; export declare function getDefaultMod11WeightsForLength(length: number): number[];