sodium_compare

Comparing large numbers.

It is suitable for lexicographical comparisons, or to compare nonces and counters stored in little-endian format. However, it is slower than sodium_memcmp(). The comparison is done in constant time for a given length.

extern (C) @nogc nothrow pure
int
sodium_compare
(
const(ubyte)* b1_
,
const(ubyte)* b2_
,
size_t len
)

Return Value

Type: int

-1 if b1_ < b2_, 1 if b1_ > b2_ and 0 if b1_ == b2_

See Also

Meta