- Source: src/utils/base64/index.js (Line 7)
Methods
-
<static> ArrayBufferToBase64(arrayBuffer [, mediaType])
-
Converts an ArrayBuffer into a base64 string.
The resulting string can optionally be a data uri if the
mediaTypeargument is provided.See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details.
Parameters:
Name Type Argument Description arrayBufferArrayBuffer The Array Buffer to encode.
mediaTypestring <optional>
An optional media type, i.e.
audio/oggorimage/jpeg. If included the resulting string will be a data URI.- Since: 3.18.0
- Source: src/utils/base64/ArrayBufferToBase64.js (Line 10)
Returns:
The base64 encoded Array Buffer.
- Type
- string
-
<static> Base64ToArrayBuffer(base64)
-
Converts a base64 string, either with or without a data uri, into an Array Buffer.
Parameters:
Name Type Description base64string The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding.
- Since: 3.18.0
- Source: src/utils/base64/Base64ToArrayBuffer.js (Line 18)
Returns:
An ArrayBuffer decoded from the base64 data.
- Type
- ArrayBuffer
