Sha256: 0dbb78e876afa0cdb3e943eb735138aa653dd52b183bd637471ca197bdb41a73
Contents?: true
Size: 498 Bytes
Versions: 19
Compression:
Stored size: 498 Bytes
Contents
# frozen_string_literal: true require 'openssl' # Much of this comes from Rodauth. module QuoVadis module Hmacable def compute_hmac(data) OpenSSL::HMAC.hexdigest 'SHA256', hmac_secret, data end def timing_safe_eql?(provided, actual) provided = provided.to_s Rack::Utils.secure_compare(provided.ljust(actual.length), actual) && provided.length == actual.length end private def hmac_secret Rails.application.secret_key_base end end end
Version data entries
19 entries across 19 versions & 1 rubygems