Module: Utils::HashUtils
- Included in:
- AsymmetricKey, CLPublicKey
- 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 account_hash_from_byte_to_hex(account_hash_byte_array) prefix = "account-hash-" hash_hex = account_hash_byte_array.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 |