nwaku/waku/v2/utils/requests.nim

11 lines
225 B
Nim
Raw Normal View History

# Request utils.
2021-07-22 08:43:41 +00:00
{.push raises: [Defect].}
import bearssl, stew/byteutils
proc generateRequestId*(rng: ref BrHmacDrbgContext): string =
var bytes: array[10, byte]
brHmacDrbgGenerate(rng[], bytes)
return toHex(bytes)