Class: Sodium::Hash
Class Method Summary collapse
Methods included from Delegate
class_methods, included, #primitive
Class Method Details
.hash(message) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/sodium/hash.rb', line 6 def self.hash() = () Sodium::Buffer.empty self.implementation[:BYTES] do |digest| self.implementation.nacl( digest .to_ptr, .to_ptr, .bytesize ) or raise Sodium::CryptoError, 'failed to generate a hash for the message' end end |