Decodes a base64 string into bytes.
Tolerant of input variation: a leading data:...;base64, prefix is stripped, both the standard and URL-safe alphabets are accepted, and missing = padding is restored before decoding.
data:...;base64,
=
The base64 (or base64url, or data-URI) string.
The decoded bytes.
If the input is not valid base64.
1.0.3
import { fromBase64 } from 'edgeport/util';new TextDecoder().decode(fromBase64('aGk-Pw')); // 'hi>?' Copy
import { fromBase64 } from 'edgeport/util';new TextDecoder().decode(fromBase64('aGk-Pw')); // 'hi>?'
Decodes a base64 string into bytes.
Tolerant of input variation: a leading
data:...;base64,prefix is stripped, both the standard and URL-safe alphabets are accepted, and missing=padding is restored before decoding.