index.js 517 B

12345678910111213141516171819
  1. 'use strict';
  2. module.exports = function SHA(algorithm) {
  3. var alg = algorithm.toLowerCase();
  4. var Algorithm = module.exports[alg];
  5. if (!Algorithm) {
  6. throw new Error(alg + ' is not supported (we accept pull requests)');
  7. }
  8. return new Algorithm();
  9. };
  10. module.exports.sha = require('./sha');
  11. module.exports.sha1 = require('./sha1');
  12. module.exports.sha224 = require('./sha224');
  13. module.exports.sha256 = require('./sha256');
  14. module.exports.sha384 = require('./sha384');
  15. module.exports.sha512 = require('./sha512');