Comparing version 1.0.1 to 2.0.0
@@ -0,1 +1,6 @@ | ||
2.0.0 / 2016-04-11 | ||
------------------ | ||
- rewritten, license change BSD-3 to MIT. [#13][#13] | ||
- stream support [#13][#13] | ||
1.0.1 / 2015-05-05 | ||
@@ -37,1 +42,28 @@ ------------------ | ||
* initial release | ||
<!--- add streams support, unroll loops [enhancement] --> | ||
[#13]: https://github.com/crypto-browserify/ripemd160/pull/13 | ||
<!--- Update all dependencies 🌴 [greenkeeper] --> | ||
[#12]: https://github.com/crypto-browserify/ripemd160/pull/12 | ||
<!--- little optimizations [enhancement] --> | ||
[#11]: https://github.com/crypto-browserify/ripemd160/pull/11 | ||
<!--- Added LICENSE file to repo --> | ||
[#10]: https://github.com/crypto-browserify/ripemd160/pull/10 | ||
<!--- Add LICENCE file --> | ||
[#9]: https://github.com/crypto-browserify/ripemd160/pull/9 | ||
<!--- Support streaming [enhancement] --> | ||
[#8]: https://github.com/crypto-browserify/ripemd160/issues/8 | ||
<!--- Unroll loops [enhancement] --> | ||
[#7]: https://github.com/crypto-browserify/ripemd160/pull/7 | ||
<!--- Use SPDX-standard license naming --> | ||
[#6]: https://github.com/crypto-browserify/ripemd160/pull/6 | ||
<!--- License --> | ||
[#5]: https://github.com/crypto-browserify/ripemd160/issues/5 | ||
<!--- Add BSD license to package.json --> | ||
[#4]: https://github.com/crypto-browserify/ripemd160/pull/4 | ||
<!--- Indicate byte array inputs are supported too --> | ||
[#3]: https://github.com/crypto-browserify/ripemd160/pull/3 | ||
<!--- Node-specific implementation --> | ||
[#2]: https://github.com/crypto-browserify/ripemd160/pull/2 | ||
<!--- Incorrect name of convert-string dependency in bower.json --> | ||
[#1]: https://github.com/crypto-browserify/ripemd160/pull/1 |
{ | ||
"name": "ripemd160", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Compute ripemd160 of bytes or strings.", | ||
@@ -14,8 +14,7 @@ "keywords": [ | ||
], | ||
"license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"mocha": "^2.1.0", | ||
"mochify": "^2.1.1", | ||
"standard": "3.x" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"index.js" | ||
], | ||
"main": "./index", | ||
"repository": { | ||
@@ -25,8 +24,16 @@ "url": "https://github.com/crypto-browserify/ripemd160", | ||
}, | ||
"main": "./lib/ripemd160.js", | ||
"dependencies": {}, | ||
"scripts": { | ||
"test": "mocha test", | ||
"browser-test": "mochify --wd -R spec" | ||
"lint": "standard", | ||
"test": "npm run lint && npm run unit", | ||
"unit": "node test/*.js" | ||
}, | ||
"dependencies": { | ||
"hash-base": "^2.0.0", | ||
"inherits": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"hash-test-vectors": "^1.3.2", | ||
"standard": "^6.0.7", | ||
"tape": "^4.5.1" | ||
} | ||
} |
105
README.md
@@ -1,100 +0,27 @@ | ||
ripemd160 | ||
========= | ||
# ripemd160 | ||
JavaScript component to compute the RIPEMD-160 hash of strings or bytes. This hash is commonly used in crypto currencies | ||
like Bitcoin. | ||
[![NPM Package](https://img.shields.io/npm/v/ripemd160.svg?style=flat-square)](https://www.npmjs.org/package/ripemd160) | ||
[![Build Status](https://img.shields.io/travis/crypto-browserify/ripemd160.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/ripemd160) | ||
[![Dependency status](https://img.shields.io/david/crypto-browserify/ripemd160.svg?style=flat-square)](https://david-dm.org/crypto-browserify/ripemd160#info=dependencies) | ||
Usage | ||
----- | ||
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) | ||
### Install | ||
Node style `ripemd160` on pure JavaScript. | ||
npm install --save ripemd160 | ||
## Example | ||
### ripemd160(input) | ||
`input` should be either a `string`, `Buffer`, or an `Array`. It returns a `Buffer`. | ||
**example 1**: | ||
```js | ||
var ripemd16 = require('ripemd160') | ||
var RIPEMD160 = require('ripemd160') | ||
var data = 'hello' | ||
var result = ripemd160(data) | ||
console.log(result.toString('hex')) | ||
// => 108f07b8382412612c048d07d13f814118445acd | ||
``` | ||
console.log(new RIPEMD160().update('42').digest('hex')) | ||
// => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8 | ||
**example 2**: | ||
```js | ||
var ripemd16 = require('ripemd160') | ||
var data = new Buffer('hello', 'utf8') | ||
var result = ripemd160(data) | ||
console.log(result.toString('hex')) | ||
// => 108f07b8382412612c048d07d13f814118445acd | ||
var ripemd160stream = new RIPEMD160() | ||
ripemd160stream.end('42') | ||
console.log(ripemd160stream.read().toString('hex')) | ||
// => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8 | ||
``` | ||
## LICENSE | ||
#### Converting Buffers | ||
If you're not familiar with the Node.js ecosystem, type `Buffer` is a common way that a developer can pass around | ||
binary data. `Buffer` also exists in the [Browserify](http://browserify.org/) environment. Converting to and from Buffers is very easy. | ||
##### To buffer | ||
```js | ||
// from string | ||
var buf = new Buffer('some string', 'utf8') | ||
// from hex string | ||
var buf = new Buffer('3f5a4c22', 'hex') | ||
// from array | ||
var buf = new Buffer([1, 2, 3, 4]) | ||
``` | ||
#### From buffer | ||
```js | ||
// to string | ||
var str = buf.toString('utf8') | ||
// to hex string | ||
var hex = buf.toString('hex') | ||
// to array | ||
var arr = [].slice.call(buf) | ||
``` | ||
Testing | ||
------- | ||
### Install dev deps: | ||
npm install --development | ||
### Test in Node.js: | ||
npm run test | ||
### Test in a Browser: | ||
Testing in the browser uses the excellent [Mochify](https://github.com/mantoni/mochify.js). Mochify can use either PhantomJS | ||
or an actual browser. You must have Selenium installed if you want to use an actual browser. The easiest way is to | ||
`npm install -g start-selenium` and then run `start-selenium`. | ||
Then run: | ||
npm run browser-test | ||
License | ||
------- | ||
Licensed: BSD3-Clause | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19190
264
2
4
28
+ Addedhash-base@^2.0.0
+ Addedinherits@^2.0.1
+ Addedhash-base@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)