Method: Mongo::Crypt::Hooks.hash_sha256

Defined in:
lib/mongo/crypt/hooks.rb

.hash_sha256(input) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A crypto hash (SHA-256) function

Parameters:

  • input (String)

    The data to be hashed

Returns:

  • (String)

Raises:

  • (Exception)

    Exceptions raised during encryption are propagated to caller.



88
89
90
# File 'lib/mongo/crypt/hooks.rb', line 88

def hash_sha256(input)
  Digest::SHA2.new(256).digest(input)
end