Module base module

module multibase

multibase encoding and decoding module

Citation:

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

or

1
var multibase = require('multibase');

static function

encode

Encode data in a multibase fashion

1 2
static String multibase.encode(Buffer data, String codec);

Call parameters:

  • data:Buffer, the data to be encoded
  • codec: String, specifies the encoding method

Return result:

  • String, returns the encoded string

decode

Decode string to binary data in multibase way

1
static Buffer multibase.decode(String data);

Call parameters:

  • data: String, the string to decode

Return result:

  • Buffer, returns the decoded binary data