nim-eth/eth/common/utils.nim

11 lines
243 B
Nim
Raw Normal View History

2019-02-05 10:10:36 +00:00
import nimcrypto, hashes, byteutils, eth_types
proc hash*(d: MDigest): Hash {.inline.} = hash(d.data)
proc parseAddress*(hexString: string): EthAddress =
hexToPaddedByteArray[20](hexString)
proc `$`*(a: EthAddress): string =
a.toHex()