-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
34 lines (31 loc) · 641 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
/**
* @file nodejs-hash-performance main
* @module nodejs-hash-performance
* @subpackage main
* @version 0.0.0
* @author hex7c0 <hex7c0@gmail.com>
* @copyright hex7c0 2014
* @license GPLv3
*/
/*
* initialize module
*/
var crypto = require('crypto');
/*
* functions
*/
/**
* main
*
* @exports hashes
* @function hashes
* @param {String|Buffer} raw - Check README.md
* @param {String} hash - Check README.md
* @param {String} encoding - Check README.md
* @return {Object}
*/
function hashes(raw, hash, encoding) {
return crypto.createHash(hash).update(raw).digest(encoding);
}
module.exports = hashes;