@lowentry/utils 1.25.2 → 1.25.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowentry/utils",
3
- "version": "1.25.2",
3
+ "version": "1.25.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/src/LeUtils.js CHANGED
@@ -2982,7 +2982,14 @@ export const LeUtils = {
2982
2982
  base64ToBytes:
2983
2983
  (base64string) =>
2984
2984
  {
2985
- return Uint8Array.from(LeUtils.atob(base64string.trim()), c => c.charCodeAt(0));
2985
+ const binary = LeUtils.atob(base64string.trim());
2986
+ const len = binary.length;
2987
+ let data = new Uint8Array(len);
2988
+ for(let i = 0; i < len; i++)
2989
+ {
2990
+ data[i] = binary.charCodeAt(i);
2991
+ }
2992
+ return data;
2986
2993
  },
2987
2994
 
2988
2995
  /**
@@ -2994,7 +3001,14 @@ export const LeUtils = {
2994
3001
  bytesToBase64:
2995
3002
  (arraybuffer) =>
2996
3003
  {
2997
- return LeUtils.btoa(String.fromCharCode(...new Uint8Array(arraybuffer)));
3004
+ const bytes = new Uint8Array(arraybuffer);
3005
+ const len = bytes.byteLength;
3006
+ let binary = '';
3007
+ for(let i = 0; i < len; i++)
3008
+ {
3009
+ binary += String.fromCharCode(bytes[i]);
3010
+ }
3011
+ return LeUtils.btoa(binary);
2998
3012
  },
2999
3013
 
3000
3014
  /**