Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Uint8Array.prototype.setFromBase64()

2 tags 1 category

The setFromBase64() method of Uint8Array instances populates this Uint8Array object with bytes from a base64-encoded string, returning an object indicating how many bytes were read and written.

This method is most suitable for populating a pre-allocated array buffer. If you just want to create a new Uint8Array object from a base64-encoded string, use the static method Uint8Array.fromBase64() instead.

Return value: read The number of base64 characters read from the input string. If the decoded data fits into the array, this is the length of the input string (including padding); otherwise, it is the length up to the last complete 4-character chunk that fits into the array. Chunks will never be split (because the remaining bits cannot be partially “put back” into the base64 without completely re-encoding it); if the next chunk cannot fit into the remainder of the array, it will be entirely unread, resulting in the last one or two bytes of the array not being written. written The number of bytes written to the Uint8Array. Will never be greater than this Uint8Array’s byteLength.

Syntax example: setFromBase64(string)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…