Module: Utils::HashUtils

Included in:
AsymmetricKey, CLPublicKey, Ed25519Key
Defined in:
lib/utils/hash_utils.rb

Class Method Summary collapse

Class Method Details

.account_hash_from_byte_to_hex(account_hash_byte_array) ⇒ Object



13
14
15
16
17
# File 'lib/utils/hash_utils.rb', line 13

def ()
  prefix = "account-hash-"
  hash_hex = .pack("C*").unpack("H*").first
  prefix + hash_hex
end

.byte_hash(arr) ⇒ Object



7
8
9
10
11
# File 'lib/utils/hash_utils.rb', line 7

def byte_hash(arr)
  str = arr.pack("C*").unpack("H*").first
  key = Blake2::Key.none
  Blake2.bytes(str, key, 32)
end