satim-module - v1.0.0
    Preparing search index...

    Function deriveOrderNumber

    • Derive a stable 10-digit SATIM order number from a merchant reference.

      Maps the first 48 bits of SHA-256 into the inclusive-exclusive range [1_000_000_000, 10_000_000_000), satisfying SATIM's orderNumber format constraint (AN.10). Same inputs always produce the same output.

      Modulo bias: 2^48 mod 9_000_000_000 ≠ 0, so output values are not perfectly uniform. The bias is ~3% (some 10-digit numbers appear 32 times across the 2^48 input space while others appear 31). Acceptable for order-number derivation; not suitable for cryptographic primitives.

      Parameters

      • merchantRef: string
      • currency: string = "012"
      • mode: Mode = "register"

      Returns string