@polkadot/x-randomvalues
Advanced tools
Comparing version 10.2.6 to 10.3.1
@@ -12,2 +12,10 @@ // Copyright 2017-2023 @polkadot/x-randomvalues authors & contributors | ||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | ||
const map = new Uint8Array(256); | ||
// We use charCodeAt for access here and in the decoder loop - this is faster | ||
// on lookups (array + numbers) and also faster than accessing the specific | ||
// character via data[i] (around a 50% improvement on perf tests) | ||
for (let i = 0; i < chars.length; i++) { | ||
map[chars.charCodeAt(i)] = i; | ||
} | ||
export function base64Decode(data) { | ||
@@ -19,3 +27,3 @@ const bytes = []; | ||
// each character represents 6 bits | ||
byte = byte << 6 | chars.indexOf(data[i]); | ||
byte = byte << 6 | map[data.charCodeAt(i)]; | ||
@@ -22,0 +30,0 @@ // each byte needs to contain 8 bits |
@@ -18,2 +18,10 @@ "use strict"; | ||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | ||
const map = new Uint8Array(256); | ||
// We use charCodeAt for access here and in the decoder loop - this is faster | ||
// on lookups (array + numbers) and also faster than accessing the specific | ||
// character via data[i] (around a 50% improvement on perf tests) | ||
for (let i = 0; i < chars.length; i++) { | ||
map[chars.charCodeAt(i)] = i; | ||
} | ||
function base64Decode(data) { | ||
@@ -25,3 +33,3 @@ const bytes = []; | ||
// each character represents 6 bits | ||
byte = byte << 6 | chars.indexOf(data[i]); | ||
byte = byte << 6 | map[data.charCodeAt(i)]; | ||
@@ -28,0 +36,0 @@ // each byte needs to contain 8 bits |
@@ -16,4 +16,4 @@ "use strict"; | ||
type: 'cjs', | ||
version: '10.2.6' | ||
version: '10.3.1' | ||
}; | ||
exports.packageInfo = packageInfo; |
@@ -20,3 +20,3 @@ { | ||
"type": "module", | ||
"version": "10.2.6", | ||
"version": "10.3.1", | ||
"main": "./cjs/node.js", | ||
@@ -83,4 +83,4 @@ "module": "./node.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.7", | ||
"@polkadot/x-global": "10.2.6" | ||
"@babel/runtime": "^7.20.13", | ||
"@polkadot/x-global": "10.3.1" | ||
}, | ||
@@ -87,0 +87,0 @@ "denoDependencies": { |
@@ -10,3 +10,3 @@ // Copyright 2017-2023 @polkadot/x-randomvalues authors & contributors | ||
type: 'esm', | ||
version: '10.2.6' | ||
version: '10.3.1' | ||
}; |
@@ -1,3 +0,3 @@ | ||
import { insecureRandomValues } from './fallback'; | ||
import { getRandomValues as getRandomValuesGlobal } from './browser'; | ||
export { packageInfo } from './packageInfo'; | ||
export declare const getRandomValues: typeof insecureRandomValues; | ||
export declare const getRandomValues: typeof getRandomValuesGlobal; |
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
23961
22
253
+ Added@polkadot/x-global@10.3.1(transitive)
- Removed@polkadot/x-global@10.2.6(transitive)
Updated@babel/runtime@^7.20.13
Updated@polkadot/x-global@10.3.1