1.2.0 • Published 10 years ago

xbase64 v1.2.0

Weekly downloads
32
License
MIT
Repository
github
Last release
10 years ago

xbase64

Smart base64 encoder & decoder for Javascript

Installation

Node.js:

npm install xbase64

Bower:

$ bower install xbase64

Browser:

<script src="/pathTo/xbase64.js"></script>

Usage

Require it within your module:

  var xbase64 = require('xbase64');

byte buffer type defined.

NodeJS: Buffer, string (input only) Browser: Number Array, string (input only)

.encode(bytebuffer, strip)

Encodes byte buffer as a Base64 string.

xbase64.encode("i'm xbase64");

output string: aSdtIHhiYXNlNjQ=

xbase64.encode("i'm xbase64", true)

output string: aSdtIHhiYXNlNjQ

.decode(string)

Decodes a Base64 string as a byte buffer.

xbase64.decode("aSdtIHhiYXNlNjQ")

output to byte buffer: i'm xbase64

xbase64.decode("aSdtIHhiYXNlNjQ=")

output to byte buffer: i'm xbase64

.decodeAsText(string)

Decodes a Base64 string as a string.

xbase64.decodeAsText("aSdtIHhiYXNlNjQ")

output to string: i'm xbase64

xbase64.decodeAsText("aSdtIHhiYXNlNjQ=")

output to string: i'm xbase64


.urlencode(bytebuffer, strip)

Encodes byte buffer as a URL Safe Base64 string.

.urldecode(string)

Decodes a URL Safe Base64 string as a byte buffer.

.urldecodeAsText(string)

Decodes a URL Safe Base64 string as a string.


.create(string)

Create a customize table XBase64 object.

XBase64.encode(buffer, strip)

Encodes a buffer as a XBase64 string.

XBase64.decode(string)

Decodes a XBase64 string as a byte buffer.

XBase64.decodeAsText(string)

Decodes a XBase64 string as a string.


random(string)

Generate new string from parameter string's random order.

1.2.0

10 years ago

1.1.0

10 years ago

1.0.5

11 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago