mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-07 16:03:13 +00:00
14 lines
241 B
Nim
14 lines
241 B
Nim
import pkg/libp2p/crypto/crypto
|
|
import pkg/bearssl
|
|
|
|
type
|
|
Rng* = RandomNumberGenerator
|
|
RandomNumberGenerator = ref BrHmacDrbgContext
|
|
|
|
var rng {.threadvar.}: Rng
|
|
|
|
proc instance*(t: type Rng): Rng =
|
|
if rng.isNil:
|
|
rng = newRng()
|
|
rng
|