nwaku/waku/utils/requests.nim

14 lines
292 B
Nim

# Request utils.
when (NimMajor, NimMinor) < (1, 4):
{.push raises: [Defect].}
else:
{.push raises: [].}
import bearssl/rand, stew/byteutils
proc generateRequestId*(rng: ref HmacDrbgContext): string =
var bytes: array[10, byte]
hmacDrbgGenerate(rng[], bytes)
return toHex(bytes)