isomorphic.js
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -12,13 +12,15 @@ /* eslint-env browser */ | ||
// browser | ||
const arr = new Uint8Array(len) | ||
const buf = new ArrayBuffer(len) | ||
const arr = new Uint8Array(buf) | ||
isoCrypto.getRandomValues(arr) | ||
return arr.buffer | ||
return buf | ||
} | ||
: len => { | ||
// polyfill | ||
const arr = new Uint8Array(len) | ||
const buf = new ArrayBuffer(len) | ||
const arr = new Uint8Array(buf) | ||
for (let i = 0; i < len; i++) { | ||
arr[i] = Math.ceil((Math.random() * 0xFFFFFFFF) >>> 0) | ||
} | ||
return arr.buffer | ||
return buf | ||
} | ||
@@ -25,0 +27,0 @@ |
{ | ||
"name": "isomorphic.js", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Isomorphic JavaScript helper functions (performance, crpyto, ..)", | ||
@@ -8,7 +8,12 @@ "sideEffects": false, | ||
"browser": "./iso-browser.js", | ||
"unpkg": "./iso-browser.js", | ||
"dependencies": {}, | ||
"funding": { | ||
"type": "GitHub Sponsors ❤", | ||
"url": "https://github.com/sponsors/dmonad" | ||
}, | ||
"devDependencies": { | ||
"standard": "^14.0.0", | ||
"typescript": "^3.7.4", | ||
"@types/node": "^13.1.6" | ||
"@types/node": "^13.13.9", | ||
"standard": "^14.3.4", | ||
"typescript": "^3.9.3" | ||
}, | ||
@@ -15,0 +20,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3428
38