Skip to content

Utilities

Tony Arcieri edited this page Dec 31, 2013 · 2 revisions

RbNaCl utilities provide, among other things, tools for securely comparing two strings in constant time. Here's an example which compares two 32-bit strings:

# constant time comparisons.
RbNaCl::Util.verify32(string_one, string_two)
#=> true/false.  See also verify16 
Clone this wiki locally