import hash from 'hash.js' ; export function sha512 ( payload ) { return Uint8Array . from ( hash . sha512 ( ) . update ( payload ) . digest ( ) ) ; } export function sha256 ( payload ) { return Uint8Array . from ( hash . sha256 ( ) . update ( payload ) . digest ( ) ) ; } export function ripemd160 ( payload ) { return Uint8Array . from ( hash . ripemd160 ( ) . update ( payload ) . digest ( ) ) ; } export function hash160 ( payload ) { return ripemd160 ( sha256 ( payload ) ) ; } export function hash256 ( payload ) { return sha256 ( sha256 ( payload ) ) ; }