pureweb.util. stringUtil

The stringUtil namespace provides utility methods for working with strings.

Method Summary

arrayBufferToBase64
Converts an ArrayBuffer into a base64 encoded string and returns that string.
base64ToArrayBuffer
Converts a base64 encoded string into an ArrayBuffer and returns that ArrayBuffer.
decodeUTF8FromIntArray
Decodes the specified array of UTF-8 bytes into a string and returns that string.
encodeUTF8ToArrayBuffer
Encodes the specified string in UTF-8 and returns the encoded bytes.

Method Detail

<static> arrayBufferToBase64(raw, mimeType) → {string}

Converts an ArrayBuffer into a base64 encoded string and returns that string.
Parameters:
Name Type Argument Description
raw ArrayBuffer The array buffer.
mimeType string <optional>
The mimetype of the contents.

<static> base64ToArrayBuffer(base64) → {ArrayBuffer}

Converts a base64 encoded string into an ArrayBuffer and returns that ArrayBuffer.
Parameters:
Name Type Description
base64 string The base64 string.

<static> decodeUTF8FromIntArray(bytes) → {string}

Decodes the specified array of UTF-8 bytes into a string and returns that string.
Parameters:
Name Type Description
bytes Uint8Array The array of UTF-8 bytes.

<static> encodeUTF8ToArrayBuffer(str) → {ArrayBuffer}

Encodes the specified string in UTF-8 and returns the encoded bytes.
Parameters:
Name Type Description
str string The string to encode.