Sha256: 4c3236861a8feb44dc31db90590787b184f6fd0cfb429837eac6716188966796
Contents?: true
Size: 289 Bytes
Versions: 24
Compression:
Stored size: 289 Bytes
Contents
require 'base64' module SecureHeaders module HashHelper def hash_source(inline_script, digest = :SHA256) base64_hashed_content = Base64.encode64(Digest.const_get(digest).digest(inline_script)).chomp "'#{digest.to_s.downcase}-#{base64_hashed_content}'" end end end
Version data entries
24 entries across 24 versions & 1 rubygems