bitmessage-js/lib/platform.js

23 lines
465 B
JavaScript
Raw Normal View History

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