mirror of
https://github.com/logos-storage/nim-mysticeti.git
synced 2026-01-08 00:23:13 +00:00
12 lines
239 B
Nim
12 lines
239 B
Nim
type
|
|
Hash*[Hashing] = object
|
|
value: Hashing.Hash
|
|
Hashing*[Hash] = object
|
|
|
|
func hash*(T: type Hashing, bytes: openArray[byte]): auto =
|
|
mixin hash
|
|
Hash[T](value: T.Hash.hash(bytes))
|
|
|
|
func `$`*(hash: Hash): string =
|
|
$hash.value
|