Module codecs

This module extends the String class with encoding and decoding functionalities.

public methods:

listEncoders()

Returns an Array with all encoder names.

listDecoders()

Returns an Arra with all decoder names.

globals:

String::decode(codec)

Decodes an encoded string using the codec specified by the codecparameter .
All parameters but the codec parameter are forwarded to the codec.

String::encode(codec)

Encodes a string using the codec specified by the codec parameter.
All Parameters but the codec parameter are forwarded to the codec.

String::decode_base64()

Decodes a Base64 encoded string to a byte string.

String::encode_base64()

Encodes a string using Base64.

String::decode_uri()

Decodes a URI using decodeURI.

String::encode_uri()

Encodes a URI using encodeURI.

codecs

Currently there are only two codecs base64 and uri.
If you want to add your own codecs at runtime just extend the Stringl class by adding a String.prototype.encode_yourCodec or String.prototype.decode_yourCodec method.