sodium_memcmp

Constant-time test for equality

WARNING: sodium_memcmp() must be used to verify if two secret keys are equal, in constant time. This function is not designed for lexicographical comparisons.

  1. alias sodium_memcmp = deimos.sodium.utils.sodium_memcmp
    alias sodium_memcmp = deimos.sodium.utils.sodium_memcmp
  2. bool sodium_memcmp(ubyte[] b1_, ubyte[] b2_)

Return Value

0 if the keys are equal, and -1 if they differ.

See Also

Meta