Skip to content

Commit 3d7c496

Browse files
author
keenan
committed
add js-sha256 dependency
1 parent d9539bf commit 3d7c496

File tree

14 files changed

+2707
-0
lines changed

14 files changed

+2707
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "js-sha256",
3+
"version": "0.8.0",
4+
"main": [
5+
"src/sha256.js"
6+
],
7+
"ignore": [
8+
"samples",
9+
"tests"
10+
],
11+
"homepage": "https://github.com/emn178/js-sha256",
12+
"_release": "0.8.0",
13+
"_resolution": {
14+
"type": "version",
15+
"tag": "v0.8.0",
16+
"commit": "08b64a16e56276f871a615d7eedc37e2cb17b898"
17+
},
18+
"_source": "https://github.com/emn178/js-sha256.git",
19+
"_target": "^0.8.0",
20+
"_originalSource": "js-sha256",
21+
"_direct": true
22+
}

bower_components/js-sha256/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/
2+
/coverage/
3+
/.nyc_output/

bower_components/js-sha256/.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/node_modules/
2+
/coverage/
3+
/.nyc_output/
4+
/tests/
5+
.covignore
6+
.travis.yml
7+
.npmignore
8+
bower.json
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "6.11.4"
4+
- "8.6.0"
5+
before_install:
6+
- npm install coveralls
7+
after_success: npm run coveralls
8+
branches:
9+
only:
10+
- master
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Change Log
2+
3+
## v0.8.0 / 2017-11-19
4+
### Added
5+
- support for web worker.
6+
- typescript types. #10
7+
8+
### Changed
9+
- prevent webpack to require dependencies.
10+
11+
## v0.7.1 / 2017-10-31
12+
### Improved
13+
- performance of hBytes increment.
14+
15+
## v0.7.0 / 2017-10-31
16+
### Fixed
17+
- incorrect result when file size >= 512M.
18+
19+
## v0.6.0 / 2017-07-11
20+
### Added
21+
- HMAC feature.
22+
23+
### Changed
24+
- throw error if input type is incorrect.
25+
26+
## v0.5.0 / 2017-01-24
27+
### Added
28+
- Streaming support #6
29+
30+
## v0.4.0 / 2017-01-23
31+
### Added
32+
- AMD support.
33+
34+
### Fixed
35+
- ArrayBuffer dosen't work in Webpack.
36+
37+
## v0.3.2 / 2016-09-12
38+
### Added
39+
- CommonJS detection.
40+
41+
## v0.3.1 / 2016-09-08
42+
### Added
43+
- some files to npm package.
44+
45+
### Fixed
46+
- coding style.
47+
48+
## v0.3.0 / 2015-05-23
49+
### Added
50+
- support for ArrayBuffer input.
51+
52+
## v0.2.3 / 2015-02-11
53+
### Added
54+
- support for byte array input.
55+
56+
## v0.2.2 / 2015-02-10
57+
### Improved
58+
- performance.
59+
60+
## v0.2.1 / 2015-02-05
61+
### Fixed
62+
- special length bug.
63+
64+
### Added
65+
- test cases.
66+
67+
## v0.2.0 / 2015-02-03
68+
### Removed
69+
- ascii parameter.
70+
71+
### Improved
72+
- performance.
73+
74+
### Added
75+
- test cases.
76+
77+
## v0.1.4 / 2015-01-24
78+
### Improved
79+
- performance.
80+
81+
## v0.1.3 / 2015-01-09
82+
### Improved
83+
- performance.
84+
85+
## v0.1.2 / 2015-01-06
86+
### Added
87+
- bower package.
88+
- travis.
89+
- coveralls.
90+
91+
### Fixed
92+
- JSHint warnings.
93+
94+
## v0.1.1 / 2014-07-27
95+
### Fixed
96+
- accents bug.
97+
98+
## v0.1.0 / 2014-01-05
99+
### Added
100+
- initial release.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2014-2017 Chen, Yi-Cyuan
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bower_components/js-sha256/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# js-sha256
2+
[![Build Status](https://travis-ci.org/emn178/js-sha256.svg?branch=master)](https://travis-ci.org/emn178/js-sha256)
3+
[![Coverage Status](https://coveralls.io/repos/emn178/js-sha256/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha256?branch=master)
4+
[![CDNJS](https://img.shields.io/cdnjs/v/js-sha256.svg)](https://cdnjs.com/libraries/js-sha256/)
5+
[![NPM](https://nodei.co/npm/js-sha256.png?stars&downloads)](https://nodei.co/npm/js-sha256/)
6+
A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.
7+
8+
## Demo
9+
[SHA256 Online](http://emn178.github.io/online-tools/sha256.html)
10+
[SHA224 Online](http://emn178.github.io/online-tools/sha224.html)
11+
12+
## Download
13+
[Compress](https://raw.github.com/emn178/js-sha256/master/build/sha256.min.js)
14+
[Uncompress](https://raw.github.com/emn178/js-sha256/master/src/sha256.js)
15+
16+
## Installation
17+
You can also install js-sha256 by using Bower.
18+
19+
bower install js-sha256
20+
21+
For node.js, you can use this command to install:
22+
23+
npm install js-sha256
24+
25+
## Usage
26+
You could use like this:
27+
```JavaScript
28+
sha256('Message to hash');
29+
sha224('Message to hash');
30+
31+
var hash = sha256.create();
32+
hash.update('Message to hash');
33+
hash.hex();
34+
35+
var hash2 = sha256.update('Message to hash');
36+
hash2.update('Message2 to hash');
37+
hash2.array();
38+
39+
// HMAC
40+
sha256.hmac('key', 'Message to hash');
41+
sha224.hmac('key', 'Message to hash');
42+
43+
var hash = sha256.hmac.create('key');
44+
hash.update('Message to hash');
45+
hash.hex();
46+
47+
var hash2 = sha256.hmac.update('key', 'Message to hash');
48+
hash2.update('Message2 to hash');
49+
hash2.array();
50+
```
51+
If you use node.js, you should require the module first:
52+
```JavaScript
53+
var sha256 = require('js-sha256');
54+
```
55+
or
56+
```JavaScript
57+
var sha256 = require('js-sha256').sha256;
58+
var sha224 = require('js-sha256').sha224;
59+
```
60+
It supports AMD:
61+
```JavaScript
62+
require(['your/path/sha256.js'], function(sha256) {
63+
// ...
64+
});
65+
```
66+
or TypeScript
67+
```TypeScript
68+
import { sha256, sha224 } from 'js-sha256';
69+
```
70+
## Example
71+
```JavaScript
72+
sha256(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
73+
sha256('The quick brown fox jumps over the lazy dog'); // d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
74+
sha256('The quick brown fox jumps over the lazy dog.'); // ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c
75+
sha224(''); // d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
76+
sha224('The quick brown fox jumps over the lazy dog'); // 730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525
77+
sha224('The quick brown fox jumps over the lazy dog.'); // 619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c
78+
79+
// It also supports UTF-8 encoding
80+
sha256('中文'); // 72726d8818f693066ceb69afa364218b692e62ea92b385782363780f47529c21
81+
sha224('中文'); // dfbab71afdf54388af4d55f8bd3de8c9b15e0eb916bf9125f4a959d4
82+
83+
// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` input
84+
sha256([]); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
85+
sha256(new Uint8Array([211, 212])); // 182889f925ae4e5cc37118ded6ed87f7bdc7cab5ec5e78faef2e50048999473f
86+
87+
// Different output
88+
sha256(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
89+
sha256.hex(''); // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
90+
sha256.array(''); // [227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85]
91+
sha256.digest(''); // [227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85]
92+
sha256.arrayBuffer(''); // ArrayBuffer
93+
```
94+
95+
## License
96+
The project is released under the [MIT license](http://www.opensource.org/licenses/MIT).
97+
98+
## Contact
99+
The project's website is located at https://github.com/emn178/js-sha256
100+
Author: Chen, Yi-Cyuan ([email protected])

bower_components/js-sha256/bower.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "js-sha256",
3+
"version": "0.8.0",
4+
"main": ["src/sha256.js"],
5+
"ignore": [
6+
"samples",
7+
"tests"
8+
]
9+
}

bower_components/js-sha256/build/sha256.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower_components/js-sha256/index.d.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
type Message = string | number[] | ArrayBuffer | Uint8Array;
2+
3+
interface Hasher {
4+
/**
5+
* Update hash
6+
*
7+
* @param message The message you want to hash.
8+
*/
9+
update(message: Message): Hasher;
10+
11+
/**
12+
* Return hash in hex string.
13+
*/
14+
hex(): string;
15+
16+
/**
17+
* Return hash in hex string.
18+
*/
19+
toString(): string;
20+
21+
/**
22+
* Return hash in ArrayBuffer.
23+
*/
24+
arrayBuffer(): ArrayBuffer;
25+
26+
/**
27+
* Return hash in integer array.
28+
*/
29+
digest(): number[];
30+
31+
/**
32+
* Return hash in integer array.
33+
*/
34+
array(): number[];
35+
}
36+
37+
interface Hash {
38+
/**
39+
* Hash and return hex string.
40+
*
41+
* @param message The message you want to hash.
42+
*/
43+
(message: Message): string;
44+
45+
/**
46+
* Create a hash object.
47+
*/
48+
create(): Hasher;
49+
50+
/**
51+
* Create a hash object and hash message.
52+
*
53+
* @param message The message you want to hash.
54+
*/
55+
update(message: Message): Hasher;
56+
}
57+
58+
export var sha256: Hash;
59+
export var sha224: Hash;

0 commit comments

Comments
 (0)