diff --git a/libp2p/transports/webrtctransport.nim b/libp2p/transports/webrtctransport.nim index 8f3a76b37..b26be1c97 100644 --- a/libp2p/transports/webrtctransport.nim +++ b/libp2p/transports/webrtctransport.nim @@ -37,6 +37,14 @@ logScope: export transport, results +const charset = toSeq("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/+".items) +proc genUfrag*(rng: ref HmacDrbgContext, size: int): seq[byte] = + # https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md?plain=1#L73-L77 + result = newSeq[byte](size) + for resultIndex in 0..