idnumbers
    Preparing search index...

    Function luhnDigit

    • Implement the Luhn algorithm https://en.wikipedia.org/wiki/Luhn_algorithm

      Parameters

      • digits: number[]
      • multipliersStartByTwo: boolean = false

      Returns CheckDigit

      import { luhnDigit } from 'idnumbers';

      // The check digit that completes 7992739871 to the valid number 79927398713.
      luhnDigit([7, 9, 9, 2, 7, 3, 9, 8, 7, 1]); // 3