File tree 4 files changed +57
-8
lines changed 4 files changed +57
-8
lines changed Original file line number Diff line number Diff line change
1
+ language : node_js
2
+ cache : npm
3
+ stages :
4
+ - check
5
+ - test
6
+ - cov
7
+
8
+ node_js :
9
+ - ' 10'
10
+
11
+ os :
12
+ - linux
13
+ - osx
14
+ - windows
15
+
16
+ script : npx nyc -s npm run test:node -- --bail
17
+ after_success : npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
18
+
19
+ jobs :
20
+ include :
21
+ - stage : check
22
+ script :
23
+ - npx aegir commitlint --travis
24
+ - npx aegir dep-check
25
+ - npm run lint
26
+
27
+ - stage : test
28
+ name : chrome
29
+ addons :
30
+ chrome : stable
31
+ script : npx aegir test -t browser -t webworker
32
+
33
+ - stage : test
34
+ name : firefox
35
+ addons :
36
+ firefox : latest
37
+ script : npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
38
+
39
+ notifications :
40
+ email : false
Original file line number Diff line number Diff line change 4
4
[ ![ ] ( https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square )] ( http://ipfs.io/ )
5
5
[ ![ ] ( https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square )] ( http://webchat.freenode.net/?channels=%23ipfs )
6
6
[ ![ standard-readme compliant] ( https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square )] ( https://github.com/RichardLitt/standard-readme )
7
- [ ![ Jenkins ] ( https://ci.ipfs.team/buildStatus/icon?job= ipfs/js-ipfs-unixfs-exporter/master )] ( https://ci.ipfs.team/job/ ipfs/job/ js-ipfs-unixfs-exporter/job/master/ )
7
+ [ ![ Build Status ] ( https://flat.badgen.net/travis/ ipfs/js-ipfs-unixfs-exporter )] ( https://travis- ci.com/ ipfs/js-ipfs-unixfs-exporter )
8
8
[ ![ Codecov] ( https://codecov.io/gh/ipfs/js-ipfs-unixfs-exporter/branch/master/graph/badge.svg )] ( https://codecov.io/gh/ipfs/js-ipfs-unixfs-exporter )
9
9
[ ![ Dependency Status] ( https://david-dm.org/ipfs/js-ipfs-unixfs-exporter.svg?style=flat-square )] ( https://david-dm.org/ipfs/js-ipfs-unixfs-exporter )
10
10
[ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square )] ( https://github.com/feross/standard )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- module . exports = function randomBytes ( length ) {
4
- const buffer = Buffer . alloc ( length )
3
+ const crypto = require ( 'crypto' )
4
+ const MAX_BYTES = 65536
5
5
6
- for ( let i = 0 ; i < length ; i ++ ) {
7
- buffer [ i ] = Math . floor ( Math . random ( ) * 256 ) + 1
6
+ // One day this will be merged: https://github.com/crypto-browserify/randombytes/pull/16
7
+ module . exports = function randomBytes ( num ) {
8
+ num = parseInt ( num )
9
+ const bytes = Buffer . allocUnsafe ( num )
10
+
11
+ for ( let offset = 0 ; offset < num ; offset += MAX_BYTES ) {
12
+ let size = MAX_BYTES
13
+
14
+ if ( ( offset + size ) > num ) {
15
+ size = num - offset
16
+ }
17
+
18
+ crypto . randomFillSync ( bytes , offset , size )
8
19
}
9
20
10
- return buffer
21
+ return bytes
11
22
}
You can’t perform that action at this time.
0 commit comments