Skip to content

Commit f882a96

Browse files
committed
1 parent cfa944b commit f882a96

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

create-hash.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
1+
var createHash = require('sha.js')
22
var algs = {
3-
sha1 : require('sha.js/sha1'),
4-
sha256 : require('sha.js/sha256'),
53
md5 : toConstructor(require('./md5'))
64
}
75

@@ -26,5 +24,6 @@ function toConstructor (fn) {
2624
}
2725

2826
module.exports = function (alg) {
29-
return new algs[alg]()
27+
if(algs[alg]) return new algs[alg]()
28+
return createHash(alg)
3029
}

0 commit comments

Comments
 (0)