Skip to content

Commit

Permalink
Merge branch 'release/3.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
evanvosberg committed Apr 1, 2015
2 parents 914b89b + 514d596 commit 7ed8a08
Show file tree
Hide file tree
Showing 52 changed files with 1,382 additions and 1,325 deletions.
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contribution

# Git Flow

The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.

# Pull request

Target your pull request on `develop` branch. Other pull request won't be accepted.

# How to build

1. Clone

2. Run

```sh
npm install
```

3. Run

```sh
npm run build
```

4. Check `build` folder
57 changes: 43 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Modularized port of googlecode project crypto-js.
## Node.js (Install)

Requirements:
* Node.js
* npm (Node.js package manager)

- Node.js
- npm (Node.js package manager)

```bash
npm install crypto-js
Expand All @@ -15,6 +16,7 @@ npm install crypto-js
### Usage

Modular include:

```javascript
var AES = require("crypto-js/aes");
var SHA256 = require("crypto-js/sha256");
Expand All @@ -23,29 +25,67 @@ console.log(SHA256("Message"));
```

Including all libraries, for access to extra methods:

```javascript
var CryptoJS = require("crypto-js");
console.log(CryptoJS.HmacSHA1("Message", "Key"));
```

## Client (browser)

Requirements:

- Node.js
- Bower (package manager for frontend)

```bash
bower install crypto-js
```

### Usage

Modular include:

```javascript
require.config({
packages: [
{
name: 'crypto-js',
location: 'path-to/bower_components/crypto-js',
main: 'index'
}
]
});

require(["crypto-js/aes", "crypto-js/sha256"], function (AES, SHA256) {
console.log(SHA256("Message"));
});
```

Including all libraries, for access to extra methods:

```javascript
require("crypto-js", function (CryptoJS) {
// Above-mentioned will work or use this simple form
require.config({
paths: {
'require-js': 'path-to/bower_components/crypto-js/crypto-js'
}
});

require(["crypto-js"], function (CryptoJS) {
console.log(CryptoJS.HmacSHA1("Message", "Key"));
});
```

### Usage without RequireJS

```html
<script type="text/javascript" src="path-to/bower_components/crypto-js/crypto-js.js"></script>
<script type="text/javascript">
var encrypted = CryptoJS.AES(...);
var encrypted = CryptoJS.SHA256(...);
</script>

## API

See: https://code.google.com/p/crypto-js
Expand Down Expand Up @@ -122,17 +162,6 @@ See: https://code.google.com/p/crypto-js
- ```crypto-js/pad-zeropadding```
- ```crypto-js/pad-nopadding```

## Contribution

### Git Flow

The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.

### Pull request

Target your pull request on `develop` branch. Other pull request won't be accepted.

## License

[The MIT License (MIT)](http://opensource.org/licenses/MIT)
Expand Down
2 changes: 1 addition & 1 deletion aes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
else {
// Global (browser)
factory();
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crypto-js",
"version": "3.1.3",
"version": "3.1.4",
"description": "Modularized port of googlecode project crypto-js.",
"homepage": "http://github.com/evanvosberg/crypto-js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions cipher-core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;(function (root, factory, undef) {
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"));
Expand All @@ -9,7 +9,7 @@
}
else {
// Global (browser)
factory();
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {

Expand Down
2 changes: 1 addition & 1 deletion core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
else {
// Global (browser)
factory();
root.CryptoJS = factory();
}
}(this, function () {

Expand Down
Loading

0 comments on commit 7ed8a08

Please sign in to comment.