1.0.8 • Published 4 years ago

base64-coder-node v1.0.8

Weekly downloads
153
License
MIT
Repository
-
Last release
4 years ago

⚠️ This package is deprecated.

base64-coder-node Logo

Base64 string encoder/decoder.

NPM Package Version NPM Package Downloads NPM Package License

Installation

npm install base64-coder-node

Usage Example

var base64 = require('base64-coder-node')();

console.log(base64.encode('Base64 string encoder/decoder.'));
console.log(base64.decode('QmFzZTY0IHN0cmluZyBlbmNvZGVyL2RlY29kZXIu'));

console.log(base64.encode('Base64 string encoder/decoder.', 'utf16le'));
console.log(
  base64.decode(
    'QgBhAHMAZQA2ADQAIABzAHQAcgBpAG4AZwAgAGUAbgBjAG8AZABlAHIALwBkAGUAYwBvAGQAZQByAC4A',
    'utf16le'
  )
);

QmFzZTY0IHN0cmluZyBlbmNvZGVyL2RlY29kZXIu
Base64 string encoder/decoder.
QgBhAHMAZQA2ADQAIABzAHQAcgBpAG4AZwAgAGUAbgBjAG8AZABlAHIALwBkAGUAYwBvAGQAZQByAC4A
Base64 string encoder/decoder.

Supported Encodings

  • ascii - for 7 bit ASCII data only. This encoding method is very fast, and will strip the high bit if set.
  • utf8(default) - Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
  • utf16le - 2 or 4 bytes, little endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported.
  • ucs2 - Alias of utf16le.
  • base64 - Base64 string encoding.
  • binary - A way of encoding raw binary data into strings by using only the first 8 bits of each character. This encoding method is deprecated and should be avoided in favor of Buffer objects where possible. This encoding will be removed in future versions of Node.
  • hex - Encode each byte as two hexadecimal characters.

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

1.0.8

4 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago