Function areNumbersEqualInConstantTime

  • Performs a constant-time comparison of two number values to mitigate timing attacks (CWE-208).

    This function prevents timing attacks by ensuring that the time it takes to compare two number values is consistent, regardless of the values being compared because all bits are compared using XOR operator

    Returns

    • Returns true if both number values are identical, otherwise returns false.

    Parameters

    • a: number

      The first number value to compare.

    • b: number

      The second number value to compare.

    Returns boolean

Generated using TypeDoc