nwaku/waku/v2/utils/requests.nim

11 lines
226 B
Nim

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