Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit b457d3a

Browse files
committed
Merge pull request #6 from jbenet/aegir
refactor: use aegir
2 parents 97b425a + 773913d commit b457d3a

12 files changed

+206
-19031
lines changed

.gitignore

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1-
**/node_modules
1+
# Logs
2+
logs
23
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27+
node_modules
28+
29+
dist
30+
lib

.npmignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27+
node_modules
28+
29+
test

.travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- 4
5+
- 5
6+
7+
# Make sure we have new NPM.
8+
before_install:
9+
- npm install -g npm
10+
11+
script:
12+
- npm run lint
13+
- npm test
14+
- npm run coverage
15+
16+
addons:
17+
firefox: 'latest'
18+
19+
before_script:
20+
- export DISPLAY=:99.0
21+
- sh -e /etc/init.d/xvfb start
22+
23+
after_success:
24+
- npm run coverage-publish

.zuul.yml

-1
This file was deleted.

README.md

+32-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
js-multihashing
22
===============
33

4-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/jbenet/multihashing.svg?style=flat-square)](https://david-dm.org/jbenet/js-multihashing) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
4+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
5+
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
6+
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
7+
[![Coverage Status](https://coveralls.io/repos/github/jbenet/js-multihashing/badge.svg?branch=master)](https://coveralls.io/github/jbenet/js-multihashing?branch=master)
8+
[![Travis CI](https://travis-ci.org/jbenet/js-multihashing.svg?branch=master)](https://travis-ci.org/jbenet/js-multihashing)
9+
[![Circle CI](https://circleci.com/gh/jbenet/js-multihashing.svg?style=svg)](https://circleci.com/gh/jbenet/js-multihashing)
10+
[![Dependency Status](https://david-dm.org/jbenet/js-multihashing.svg?style=flat-square)](https://david-dm.org/jbenet/js-multihashing) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
511

612
Use all the functions in [multihash](//github.com/jbenet/multihash).
713

@@ -21,20 +27,26 @@ For now, it just uses `crypto`, but will use `sha3` and `blake2`, etc.
2127
$ npm install --save multihashing
2228
```
2329

24-
```javascript
30+
```js
2531
var multihashing = require('multihashing')
2632
```
2733

28-
### In the Browser through browserify
34+
## Use in a browser with browserify, webpack or any other bundler
35+
36+
The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.
2937

30-
Same as in Node.js, you just have to [browserify](https://github.com/substack/js-browserify) the code before serving it. See the browserify repo for how to do that.
38+
```js
39+
var multihashing = require('multihashing')
40+
```
3141

32-
### In the Browser through `<script>` tag
42+
## Use in a browser Using a script tag
3343

34-
Make the [multihashing.min.js](/dist/multihashing.min.js) available through your server and load it using a normal `<script>` tag, this will export the `multihashing` constructor on the `window` object, such that:
44+
Loading this module through a script tag will make the `multihashing` obj available in the global namespace.
3545

36-
```JavaScript
37-
var multihashing = window.multihashing
46+
```html
47+
<script src="https://npmcdn.com/multihashing/dist/index.min.js"></script>
48+
<!-- OR -->
49+
<script src="https://npmcdn.com/multihashing/dist/index.js"></script>
3850
```
3951

4052
#### Gotchas
@@ -93,6 +105,18 @@ h.digest()
93105
<SlowBuffer 14 f3 01 f3 1b e2 43 f3 4c 56 68 93 78 83 77 1f a3 81 00 2f 1a aa 5f 31 b3 f7 8e 50 0b 66 ff 2f 4f 8e a5 e3 c9 f5 a6 1b d0 73 e2 45 2c 48 04 84 b0 2e 03 ...>
94106
```
95107

108+
## API
109+
110+
### `multihashing(buf, func, length)`
111+
112+
### `digest(buf, func, length)`
113+
114+
### `createHash(func, length)`
115+
116+
### `functions`
117+
118+
An object mapping hexcodes to their hash functions.
119+
96120
## License
97121

98122
MIT

circle.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
machine:
2+
node:
3+
version: stable
4+
5+
dependencies:
6+
pre:
7+
- google-chrome --version
8+
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
9+
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
10+
- sudo apt-get update
11+
- sudo apt-get --only-upgrade install google-chrome-stable
12+
- google-chrome --version

0 commit comments

Comments
 (0)