mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-09 06:22:41 +00:00
b9d5d28af5
* chore: remove references to v2 * fix: lingering rln-relay import path
14 lines
292 B
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)
|