use standardjs formatting
This commit is contained in:
parent
09d8e440de
commit
399803affa
41 changed files with 1252 additions and 1177 deletions
src
|
@ -1,32 +1,32 @@
|
|||
var crypto = require('crypto')
|
||||
|
||||
function hash160(buffer) {
|
||||
function hash160 (buffer) {
|
||||
return ripemd160(sha256(buffer))
|
||||
}
|
||||
|
||||
function hash256(buffer) {
|
||||
function hash256 (buffer) {
|
||||
return sha256(sha256(buffer))
|
||||
}
|
||||
|
||||
function ripemd160(buffer) {
|
||||
function ripemd160 (buffer) {
|
||||
return crypto.createHash('rmd160').update(buffer).digest()
|
||||
}
|
||||
|
||||
function sha1(buffer) {
|
||||
function sha1 (buffer) {
|
||||
return crypto.createHash('sha1').update(buffer).digest()
|
||||
}
|
||||
|
||||
function sha256(buffer) {
|
||||
function sha256 (buffer) {
|
||||
return crypto.createHash('sha256').update(buffer).digest()
|
||||
}
|
||||
|
||||
// FIXME: Name not consistent with others
|
||||
function HmacSHA256(buffer, secret) {
|
||||
function HmacSHA256 (buffer, secret) {
|
||||
console.warn('Hmac* functions are deprecated for removal in 2.0.0, use node crypto instead')
|
||||
return crypto.createHmac('sha256', secret).update(buffer).digest()
|
||||
}
|
||||
|
||||
function HmacSHA512(buffer, secret) {
|
||||
function HmacSHA512 (buffer, secret) {
|
||||
console.warn('Hmac* functions are deprecated for removal in 2.0.0, use node crypto instead')
|
||||
return crypto.createHmac('sha512', secret).update(buffer).digest()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue