mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-10 17:56:32 +00:00
12 lines
274 B
Nim
12 lines
274 B
Nim
import std/random
|
|
import pkg/nitro
|
|
|
|
proc example*(_: type EthAddress): EthAddress =
|
|
EthPrivateKey.random().toPublicKey.toAddress
|
|
|
|
proc example*(_: type UInt256): UInt256 =
|
|
var bytes: array[32, byte]
|
|
for b in bytes.mitems:
|
|
b = rand(byte)
|
|
UInt256.fromBytes(bytes)
|