Skip to main content

verify

Function verify 

Source
pub fn verify(presented: Option<&str>, expected: &B3Hash) -> bool
Expand description

Compares a presented token against a stored digest in constant time.

None is not an empty string: a peer that sent no token at all is refused without ever entering the comparison, and a peer that sent an empty one still pays the full comparison so the two are indistinguishable from outside.