2015-01-03 11:29:22 +01:00
|
|
|
/**
|
|
|
|
* Node.js implementation of platform-specific routines.
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var crypto = require("crypto");
|
2015-01-03 15:52:27 +01:00
|
|
|
var createHash = crypto.createHash;
|
2015-01-03 11:29:22 +01:00
|
|
|
|
|
|
|
exports.sha512 = function(buf) {
|
2015-01-03 15:52:27 +01:00
|
|
|
return createHash("sha512").update(buf).digest();
|
2015-01-03 11:29:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.sha256 = function(buf) {
|
2015-01-03 15:52:27 +01:00
|
|
|
return createHash("sha256").update(buf).digest();
|
2015-01-03 11:29:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.ripemd160 = function(buf) {
|
2015-01-03 15:52:27 +01:00
|
|
|
return createHash("ripemd160").update(buf).digest();
|
2015-01-03 11:29:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.randomBytes = crypto.randomBytes;
|