Module: Glueby::Util::Digest
- Defined in:
- lib/glueby/util/digest.rb
Instance Method Summary collapse
-
#digest_content(content, digest) ⇒ String
Hash content with specified digest algorithm.
Instance Method Details
#digest_content(content, digest) ⇒ String
Hash content with specified digest algorithm
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/glueby/util/digest.rb', line 9 def digest_content(content, digest) case digest&.downcase when :sha256 Tapyrus.sha256(content).bth when :double_sha256 Tapyrus.double_sha256(content).bth when :none content else raise Glueby::Contract::Errors::UnsupportedDigestType end end |