v1.2.0.1-beta1
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Modules Pages

Description

ArrayBuffer Object Extensions

Public Member Functions

String toBase64 ()
 
String toHex (char separator)
 

Static Public Member Functions

String fromBase64 (any data)
 

Member Function Documentation

◆ fromBase64()

String fromBase64 ( any  data)
static

Creates and returns a new ArrayBuffer from the contents of Base64-encoded string data.

This is a static function. Use it like var buffer = ArrayBuffer.fromBase64(data).

Equivalent to atob(data).

See also
toBase64(), atob()

◆ toBase64()

String toBase64 ( )

Returns the contents of this buffer as a Base64-encoded string.

Equivalent to btoa(buffer).

See also
fromBase64(), btoa()

◆ toHex()

String toHex ( char  separator)

Returns the contents of this buffer as a hex encoded string.

Parameters
separatorOptional single separator character to place between each byte in the output. The separator must be a single character otherwise the function will fail.

For example:

let macAddress = new Uint8Array([0x12, 0x34, 0x56, 0xab, 0xcd, 0xef]).buffer;
macAddress.toHex(':'); // returns "12:34:56:ab:cd:ef"
macAddress.toHex(); // returns "123456abcdef"