Skip to content

Commit 7ed8a08

Browse files
author
evanvosberg
committed
Merge branch 'release/3.1.4'
2 parents 914b89b + 514d596 commit 7ed8a08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1382
-1325
lines changed

CONTRIBUTING.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contribution
2+
3+
# Git Flow
4+
5+
The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
6+
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.
7+
8+
# Pull request
9+
10+
Target your pull request on `develop` branch. Other pull request won't be accepted.
11+
12+
# How to build
13+
14+
1. Clone
15+
16+
2. Run
17+
18+
```sh
19+
npm install
20+
```
21+
22+
3. Run
23+
24+
```sh
25+
npm run build
26+
```
27+
28+
4. Check `build` folder

README.md

+43-14
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Modularized port of googlecode project crypto-js.
55
## Node.js (Install)
66

77
Requirements:
8-
* Node.js
9-
* npm (Node.js package manager)
8+
9+
- Node.js
10+
- npm (Node.js package manager)
1011

1112
```bash
1213
npm install crypto-js
@@ -15,6 +16,7 @@ npm install crypto-js
1516
### Usage
1617

1718
Modular include:
19+
1820
```javascript
1921
var AES = require("crypto-js/aes");
2022
var SHA256 = require("crypto-js/sha256");
@@ -23,29 +25,67 @@ console.log(SHA256("Message"));
2325
```
2426

2527
Including all libraries, for access to extra methods:
28+
2629
```javascript
2730
var CryptoJS = require("crypto-js");
2831
console.log(CryptoJS.HmacSHA1("Message", "Key"));
2932
```
3033

3134
## Client (browser)
3235

36+
Requirements:
37+
38+
- Node.js
39+
- Bower (package manager for frontend)
40+
41+
```bash
42+
bower install crypto-js
43+
```
44+
3345
### Usage
3446

3547
Modular include:
48+
3649
```javascript
50+
require.config({
51+
packages: [
52+
{
53+
name: 'crypto-js',
54+
location: 'path-to/bower_components/crypto-js',
55+
main: 'index'
56+
}
57+
]
58+
});
59+
3760
require(["crypto-js/aes", "crypto-js/sha256"], function (AES, SHA256) {
3861
console.log(SHA256("Message"));
3962
});
4063
```
4164

4265
Including all libraries, for access to extra methods:
66+
4367
```javascript
44-
require("crypto-js", function (CryptoJS) {
68+
// Above-mentioned will work or use this simple form
69+
require.config({
70+
paths: {
71+
'require-js': 'path-to/bower_components/crypto-js/crypto-js'
72+
}
73+
});
74+
75+
require(["crypto-js"], function (CryptoJS) {
4576
console.log(CryptoJS.HmacSHA1("Message", "Key"));
4677
});
4778
```
4879

80+
### Usage without RequireJS
81+
82+
```html
83+
<script type="text/javascript" src="path-to/bower_components/crypto-js/crypto-js.js"></script>
84+
<script type="text/javascript">
85+
var encrypted = CryptoJS.AES(...);
86+
var encrypted = CryptoJS.SHA256(...);
87+
</script>
88+
4989
## API
5090

5191
See: https://code.google.com/p/crypto-js
@@ -122,17 +162,6 @@ See: https://code.google.com/p/crypto-js
122162
- ```crypto-js/pad-zeropadding```
123163
- ```crypto-js/pad-nopadding```
124164

125-
## Contribution
126-
127-
### Git Flow
128-
129-
The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
130-
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.
131-
132-
### Pull request
133-
134-
Target your pull request on `develop` branch. Other pull request won't be accepted.
135-
136165
## License
137166

138167
[The MIT License (MIT)](http://opensource.org/licenses/MIT)

aes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
else {
1111
// Global (browser)
12-
factory();
12+
factory(root.CryptoJS);
1313
}
1414
}(this, function (CryptoJS) {
1515

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crypto-js",
3-
"version": "3.1.3",
3+
"version": "3.1.4",
44
"description": "Modularized port of googlecode project crypto-js.",
55
"homepage": "http://github.com/evanvosberg/crypto-js",
66
"repository": {

cipher-core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;(function (root, factory, undef) {
1+
;(function (root, factory) {
22
if (typeof exports === "object") {
33
// CommonJS
44
module.exports = exports = factory(require("./core"));
@@ -9,7 +9,7 @@
99
}
1010
else {
1111
// Global (browser)
12-
factory();
12+
factory(root.CryptoJS);
1313
}
1414
}(this, function (CryptoJS) {
1515

core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
else {
1111
// Global (browser)
12-
factory();
12+
root.CryptoJS = factory();
1313
}
1414
}(this, function () {
1515

0 commit comments

Comments
 (0)