Crypto::Subtle - Crystal 0.35.1

# module Crypto::Subtle

##
Defined in:

##
Class Method Summary

- .constant_time_byte_eq(x, y)
- .constant_time_compare(x, y) : Bool

  Compares x and y in constant time and returns `true` if they are the same, and `false` if they are not.

##
Class Method Detail

def self.constant_time_byte_eq(x, y) #
def self.constant_time_compare(x, y) : Bool #

Compares x and y in constant time and returns `true` if they are the same, and `false` if they are not.

    require "crypto/subtle"

    Crypto::Subtle.constant_time_compare("foo", "bar") # => false
    Crypto::Subtle.constant_time_compare("foo", "foo") # => true

NOTE x and y must be able to respond to `to_slice`.