diff options
author | Mario Vavti <mario@mariovavti.com> | 2020-08-22 22:14:29 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2020-08-22 22:14:29 +0200 |
commit | 4e0fc81e5dfaad3c3ed47a02df4589f5b25a88be (patch) | |
tree | eb8d2ffd4840b2cfa50499ac522c3cd276eb8b04 /library/cryptojs/components/lib-typedarrays.js | |
parent | 3b865d432ff24532b4a5e6917e23fc42b0d7fcaf (diff) | |
download | volse-hubzilla-4e0fc81e5dfaad3c3ed47a02df4589f5b25a88be.tar.gz volse-hubzilla-4e0fc81e5dfaad3c3ed47a02df4589f5b25a88be.tar.bz2 volse-hubzilla-4e0fc81e5dfaad3c3ed47a02df4589f5b25a88be.zip |
move cryptojs to addon
Diffstat (limited to 'library/cryptojs/components/lib-typedarrays.js')
-rw-r--r-- | library/cryptojs/components/lib-typedarrays.js | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/library/cryptojs/components/lib-typedarrays.js b/library/cryptojs/components/lib-typedarrays.js deleted file mode 100644 index a9ae5d4ed..000000000 --- a/library/cryptojs/components/lib-typedarrays.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -CryptoJS v3.1.2 -code.google.com/p/crypto-js -(c) 2009-2013 by Jeff Mott. All rights reserved. -code.google.com/p/crypto-js/wiki/License -*/ -(function () {
- // Check if typed arrays are supported
- if (typeof ArrayBuffer != 'function') {
- return;
- }
-
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
-
- // Reference original init
- var superInit = WordArray.init;
-
- // Augment WordArray.init to handle typed arrays
- var subInit = WordArray.init = function (typedArray) {
- // Convert buffers to uint8
- if (typedArray instanceof ArrayBuffer) {
- typedArray = new Uint8Array(typedArray);
- }
-
- // Convert other array views to uint8
- if (
- typedArray instanceof Int8Array ||
- typedArray instanceof Uint8ClampedArray ||
- typedArray instanceof Int16Array ||
- typedArray instanceof Uint16Array ||
- typedArray instanceof Int32Array ||
- typedArray instanceof Uint32Array ||
- typedArray instanceof Float32Array ||
- typedArray instanceof Float64Array
- ) {
- typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
- }
-
- // Handle Uint8Array
- if (typedArray instanceof Uint8Array) {
- // Shortcut
- var typedArrayByteLength = typedArray.byteLength;
-
- // Extract bytes
- var words = [];
- for (var i = 0; i < typedArrayByteLength; i++) {
- words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
- }
-
- // Initialize this word array
- superInit.call(this, words, typedArrayByteLength);
- } else {
- // Else call normal init
- superInit.apply(this, arguments);
- }
- };
-
- subInit.prototype = WordArray;
-}());
|