mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-17 08:21:32 +00:00
13 lines
286 B
Nim
13 lines
286 B
Nim
|
import std/random
|
||
|
import pkg/stint
|
||
|
|
||
|
proc example*[T: SomeInteger](_: type T): T =
|
||
|
rand(T)
|
||
|
|
||
|
proc example*[T,N](_: type array[N, T]): array[N, T] =
|
||
|
for item in result.mitems:
|
||
|
item = T.example
|
||
|
|
||
|
proc example*(_: type UInt256): UInt256 =
|
||
|
UInt256.fromBytes(array[32, byte].example)
|