braid-http 1.3.62 → 1.3.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -882,11 +882,11 @@ async function promise_done(promise) {
882
882
  }
883
883
 
884
884
  function random_base64url(n) {
885
- var buf = new Uint8Array(n)
886
- var crypt = (typeof crypto !== 'undefined') ? crypto : require('crypto')
887
885
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
888
- return [...(crypt.webcrypto ?? crypt).getRandomValues(buf)].
889
- map(x => chars[x % 64]).join('')
886
+ var result = ''
887
+ for (let i = 0; i < n; i++)
888
+ result += chars[Math.floor(Math.random() * 64)]
889
+ return result
890
890
  }
891
891
 
892
892
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.62",
3
+ "version": "1.3.63",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"