This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_format_color = (color) => { // Supports #fff (short rgb), #fff0 (short rgba), #e2e2e2 (full rgb) and #e2e2e2ff (full rgba) | |
const hex = color || "#00000000"; | |
const hex_length = hex.length; | |
if(hex_length === 9) { | |
return hex; | |
} else if (hex_length === 7) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function base64Encode (buf) { | |
let string = ''; | |
(new Uint8Array(buf)).forEach( | |
(byte) => { string += String.fromCharCode(byte) } | |
) | |
return btoa(string) | |
} | |
function base64Decode (string) { | |
string = atob(string); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.bitcoin = { | |
messagePrefix: '\x18Bitcoin Signed Message:\n', | |
bech32: 'bc', | |
bip32: { | |
public: 0x0488b21e, | |
private: 0x0488ade4, | |
}, | |
pubKeyHash: 0x00, | |
scriptHash: 0x05, | |
wif: 0x80, |
NewerOlder