Skip to content

Commit d97e5d9

Browse files
committed
Merge branch 'release/4.1.0'
2 parents 31d0012 + 495890c commit d97e5d9

File tree

7 files changed

+4657
-4367
lines changed

7 files changed

+4657
-4367
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,19 @@ console.log(decryptedData); // [{id: 1}, {id: 2}]
212212

213213
## Release notes
214214

215+
### 4.1.0
216+
217+
Added url safe variant of base64 encoding. [357](https://github.com/brix/crypto-js/pull/357)
218+
219+
Avoid webpack to add crypto-browser package. [364](https://github.com/brix/crypto-js/pull/364)
220+
215221
### 4.0.0
216222

217223
This is an update including breaking changes for some environments.
218224

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

221-
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.
227+
For this reason CryptoJS might not run in some JavaScript environments without native crypto module. Such as IE 10 or before or React Native.
222228

223229
### 3.3.0
224230

bower.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crypto-js",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "JavaScript library of crypto standards.",
55
"license": "MIT",
66
"homepage": "http://github.com/brix/crypto-js",
@@ -27,7 +27,8 @@
2727
"CFB",
2828
"CTR",
2929
"CBC",
30-
"Base64"
30+
"Base64",
31+
"Base64url"
3132
],
3233
"main": "index.js",
3334
"dependencies": {},

core.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
crypto = window.crypto;
2828
}
2929

30+
// Native crypto in web worker (Browser)
31+
if (typeof self !== 'undefined' && self.crypto) {
32+
crypto = self.crypto;
33+
}
34+
35+
// Native crypto from worker
36+
if (typeof globalThis !== 'undefined' && globalThis.crypto) {
37+
crypto = globalThis.crypto;
38+
}
39+
3040
// Native (experimental IE 11) crypto from window (Browser)
3141
if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
3242
crypto = window.msCrypto;
@@ -87,7 +97,7 @@
8797

8898
return subtype;
8999
};
90-
}())
100+
}());
91101

92102
/**
93103
* CryptoJS namespace.
@@ -298,8 +308,8 @@
298308
}
299309
} else {
300310
// Copy one word at a time
301-
for (var i = 0; i < thatSigBytes; i += 4) {
302-
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
311+
for (var j = 0; j < thatSigBytes; j += 4) {
312+
thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];
303313
}
304314
}
305315
this.sigBytes += thatSigBytes;

0 commit comments

Comments
 (0)