File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ export function toBase64url(arr) {
4040
4141// Unlike Buffer.from(), throws on invalid input (non-base64 symbols and incomplete chunks)
4242// Unlike Buffer.from() and Uint8Array.fromBase64(), does not allow spaces
43- // Unlike Uint8Array.fromBase64(), accepts both base64 and base64url
4443// NOTE: Always operates in strict mode for last chunk
4544
45+ // Accepts both padded and non-padded variants, only strict base64
4646export function fromBase64 ( str , format = 'uint8' ) {
4747 if ( typeof str !== 'string' ) throw new TypeError ( 'Input is not a string' )
4848
@@ -57,6 +57,7 @@ export function fromBase64(str, format = 'uint8') {
5757 return fromTypedArray ( fromBase64common ( str , false ) , format )
5858}
5959
60+ // Accepts both only non-padded strict base64url
6061export function fromBase64url ( str , format = 'uint8' ) {
6162 if ( typeof str !== 'string' ) throw new TypeError ( 'Input is not a string' )
6263
You can’t perform that action at this time.
0 commit comments