Module basic module

module base58

base58 encoding and decoding module

Citation:

1 2
var encoding = require('encoding'); var base58 = encoding.base58;

or

1
var base58 = require('base58');

static function

encode

Encode data in base58

1
static String base58.encode(Buffer data);

Call parameters:

  • data:Buffer, the data to encode

return result:

  • String, returns the encoded string

Encode data with base58check

1 2
static String base58.encode(Buffer data, Integer chk_ver);

Call parameters:

  • data:Buffer, the data to encode
  • chk_ver: Integer, specifies the verification version

return result:

  • String, returns the encoded string

decode

Decode a string to binary data in base58

1
static Buffer base58.decode(String data);

Call parameters:

  • data: String, the string to decode

return result:

  • Buffer, returns the decoded binary data

Decode strings to binary data with base58check

1 2
static Buffer base58.decode(String data, Integer chk_ver);

Call parameters:

  • data: String, the string to decode
  • chk_ver: Integer, specifies the verification version

return result:

  • Buffer, returns the decoded binary data