sodium-javascript
Advanced tools
Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "sodium-javascript", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "WIP - a pure javascript version of sodium-native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var assert = require('nanoassert') | ||
var randombytes = (function () { | ||
var QUOTA = 65536 // limit for QuotaExceededException | ||
var crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null | ||
var crypto = typeof global !== 'undefined' ? crypto = (global.crypto || global.msCrypto) : null | ||
function windowBytes (out, n) { | ||
function browserBytes (out, n) { | ||
for (var i = 0; i < n; i += QUOTA) { | ||
@@ -21,3 +21,3 @@ crypto.getRandomValues(out.subarray(i, i + Math.min(n - i, QUOTA))) | ||
if (crypto && crypto.getRandomValues) { | ||
return windowBytes | ||
return browserBytes | ||
} else if (typeof require !== 'undefined') { | ||
@@ -24,0 +24,0 @@ // Node.js. |
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
66942
18
2131