Skip to content

Commit 1839fb7

Browse files
committed
index: adhere to standard
1 parent 2aa2707 commit 1839fb7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
var exports = module.exports = function (alg) {
2-
var Alg = exports[alg.toLowerCase()]
3-
if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')
4-
return new Alg()
5-
}
1+
var exports = module.exports = function SHA (algorithm) {
2+
algorithm = algorithm.toLowerCase()
3+
4+
var Algorithm = exports[algorithm]
5+
if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
66

7+
return new Algorithm()
8+
}
79

810
exports.sha = require('./sha')
911
exports.sha1 = require('./sha1')

0 commit comments

Comments
 (0)