mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-20 21:59:41 +02:00
13 lines
289 B
JavaScript
13 lines
289 B
JavaScript
|
const crypto = require('crypto');
|
||
|
|
||
|
/**
|
||
|
* Create binary md5
|
||
|
* @param stringToHash - string to hash
|
||
|
* @returns {string} - binary hash of argument
|
||
|
*/
|
||
|
module.exports = function binaryMD5(stringToHash) {
|
||
|
return crypto.createHash('md5')
|
||
|
.update(stringToHash)
|
||
|
.digest('binary');
|
||
|
};
|