class RbNaCl::PasswordHash::Argon2

def digest_str(password)

Returns:
  • (String) - argon2 digest string

Parameters:
  • password (String) -- to be hashed
def digest_str(password)
  raise ArgumentError, "password must be a String" unless password.is_a?(String)
  result = Util.zeros(STRBYTES)
  ok = self.class.pwhash_str(
    result,
    password, password.bytesize,
    @opslimit, @memlimit
  )
  raise CryptoError, "unknown error in Argon2#digest_str" unless ok
  result.delete("\x00")
end