idnumbers
    Preparing search index...

    Function ean13Digit

    • EAN-13-style check digit with even positions weighted by 2, as in the Python library (standard EAN-13 weights them by 3). https://boxshot.com/barcode/tutorials/ean-13-calculator/

      Parameters

      • numbers: number[]

      Returns CheckDigit

      import { ean13Digit } from 'idnumbers';

      // Odd positions count once, even positions twice.
      ean13Digit([7, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // 7