Sha256: 36ceee58532038fac1a797a132401fa8f029e37a01cc0ef3a88c857c130419a2
Contents?: true
Size: 319 Bytes
Versions: 34
Compression:
Stored size: 319 Bytes
Contents
# frozen_string_literal: true 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
34 entries across 34 versions & 1 rubygems