Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
evanvosberg committed Jul 22, 2021
2 parents 31d0012 + 495890c commit d97e5d9
Show file tree
Hide file tree
Showing 7 changed files with 4,657 additions and 4,367 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,19 @@ console.log(decryptedData); // [{id: 1}, {id: 2}]

## Release notes

### 4.1.0

Added url safe variant of base64 encoding. [357](https://github.com/brix/crypto-js/pull/357)

Avoid webpack to add crypto-browser package. [364](https://github.com/brix/crypto-js/pull/364)

### 4.0.0

This is an update including breaking changes for some environments.

In this version `Math.random()` has been replaced by the random methods of the native crypto module.

For this reason CryptoJS might does not run in some JavaScript environments without native crypto module. Such as IE 10 or before or React Native.
For this reason CryptoJS might not run in some JavaScript environments without native crypto module. Such as IE 10 or before or React Native.

### 3.3.0

Expand Down
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crypto-js",
"version": "4.0.0",
"version": "4.1.0",
"description": "JavaScript library of crypto standards.",
"license": "MIT",
"homepage": "http://github.com/brix/crypto-js",
Expand All @@ -27,7 +27,8 @@
"CFB",
"CTR",
"CBC",
"Base64"
"Base64",
"Base64url"
],
"main": "index.js",
"dependencies": {},
Expand Down
16 changes: 13 additions & 3 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
crypto = window.crypto;
}

// Native crypto in web worker (Browser)
if (typeof self !== 'undefined' && self.crypto) {
crypto = self.crypto;
}

// Native crypto from worker
if (typeof globalThis !== 'undefined' && globalThis.crypto) {
crypto = globalThis.crypto;
}

// Native (experimental IE 11) crypto from window (Browser)
if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
crypto = window.msCrypto;
Expand Down Expand Up @@ -87,7 +97,7 @@

return subtype;
};
}())
}());

/**
* CryptoJS namespace.
Expand Down Expand Up @@ -298,8 +308,8 @@
}
} else {
// Copy one word at a time
for (var i = 0; i < thatSigBytes; i += 4) {
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
for (var j = 0; j < thatSigBytes; j += 4) {
thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];
}
}
this.sigBytes += thatSigBytes;
Expand Down
Loading

0 comments on commit d97e5d9

Please sign in to comment.