nwaku/waku/utils/requests.nim

11 lines
220 B
Nim
Raw Normal View History

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