module Sprockets::DigestUtils
def integrity_uri(digest)
digest - The String byte digest of the asset content.
attribute of an asset tag as per the subresource integrity specification.
Internal: Generate a "named information" URI for use in the `integrity`
def integrity_uri(digest) case digest when Digest::Base digest_class = digest.class digest = digest.digest when String digest_class = DIGEST_SIZES[digest.bytesize] else raise TypeError, "unknown digest: #{digest.inspect}" end if hash_name = NI_HASH_ALGORITHMS[digest_class] "#{hash_name}-#{pack_base64digest(digest)}" end end