Module base 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 be encoded

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 be encoded
  • chk_ver: Integer, specify 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 string to binary data by base58check

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

Call parameters:

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

Return result:

  • Buffer, returns the decoded binary data