mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
20 lines
398 B
JavaScript
20 lines
398 B
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
var crypto = require('crypto');
|
|
|
|
module.exports = function(algo, password) {
|
|
var result, sha;
|
|
|
|
if (!algo)
|
|
algo = 'sha512WithRSAEncryption';
|
|
|
|
sha = crypto.createHash(algo);
|
|
|
|
sha.update(password);
|
|
result = sha.digest('hex');
|
|
|
|
return result;
|
|
};
|
|
|
|
})();
|