Crypto::Subtle

module Crypto::Subtle

Defined in:

crypto/subtle.cr

Class Method Summary

Class Method Detail

def self.constant_time_byte_eq(x, y)Source

def self.constant_time_compare(x, y) : BoolSource

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.

© 2012–2017 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.22.0/Crypto/Subtle.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部