[Pkg-javascript-commits] [node-create-hash] 07/40: fix repo name, update readme, use browser.js as filename

Bastien Roucariès rouca at moszumanska.debian.org
Sat May 27 14:10:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-create-hash.

commit 5ef8f19b7cfbec433b6382080759195473f70fb2
Author: Calvin Metcalf <cmetcalf at appgeo.com>
Date:   Fri Jan 16 07:40:49 2015 -0500

    fix repo name, update readme, use browser.js as filename
---
 create-hash.js => browser.js |  0
 package.json                 |  8 ++++----
 readme.md                    | 17 +++++++++++++++--
 test.js                      |  2 +-
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/create-hash.js b/browser.js
similarity index 100%
rename from create-hash.js
rename to browser.js
diff --git a/package.json b/package.json
index f4b96ac..448af4e 100644
--- a/package.json
+++ b/package.json
@@ -2,14 +2,14 @@
   "name": "create-hash",
   "version": "1.0.2",
   "description": "create hashes for browserify",
-  "browser": "create-hash.js",
+  "browser": "browser.js",
   "main": "index.js",
   "scripts": {
     "test": "node test.js | tspec"
   },
   "repository": {
     "type": "git",
-    "url": "git at github.com:crypto-browserify/crypto-createHash.git"
+    "url": "git at github.com:crypto-browserify/createHash.git"
   },
   "keywords": [
     "crypto"
@@ -17,9 +17,9 @@
   "author": "",
   "license": "MIT",
   "bugs": {
-    "url": "https://github.com/crypto-browserify/crypto-createHash/issues"
+    "url": "https://github.com/crypto-browserify/createHash/issues"
   },
-  "homepage": "https://github.com/crypto-browserify/crypto-createHash",
+  "homepage": "https://github.com/crypto-browserify/createHash",
   "devDependencies": {
     "hash-test-vectors": "^1.3.2",
     "tap-spec": "^2.1.2",
diff --git a/readme.md b/readme.md
index a4ea4ef..f3231a2 100644
--- a/readme.md
+++ b/readme.md
@@ -1,6 +1,19 @@
 create-hash
 ===
 
-[![Build Status](https://travis-ci.org/crypto-browserify/crypto-createHash.svg)](https://travis-ci.org/crypto-browserify/crypto-createHash)
+[![Build Status](https://travis-ci.org/crypto-browserify/createHash.svg)](https://travis-ci.org/crypto-browserify/createHash)
 
-Node style hashes for use in the browser.
\ No newline at end of file
+Node style hashes for use in the browser, with native has functions in node. Api is the same as hashes in node:
+
+```js
+var createHash = require('create-hash');
+var hash = createHash('sha224');
+hash.update('synchronous write'); //optional encoding parameter
+hash.digest();// synchronously get result with optional encoding parameter
+
+hash.write('write to it as a stream');
+hash.end();//remember it's a stream
+hash.read();//only if you ended it as a stream though
+```
+
+To get the JavaScript version even in node do `require('create-hash/browser');`
\ No newline at end of file
diff --git a/test.js b/test.js
index 5cc2324..c326f15 100644
--- a/test.js
+++ b/test.js
@@ -5,7 +5,7 @@ var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160
 var encodings = [/*'binary',*/ 'hex', 'base64'];
 var vectors = require('hash-test-vectors')
 
-var createHash = require('./create-hash')
+var createHash = require('./browser')
 
 algorithms.forEach(function (algorithm) {
   test('test ' + algorithm + ' against test vectors', function (t) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-create-hash.git



More information about the Pkg-javascript-commits mailing list