function encode(str) {
	if (typeof str !== 'string') {
		if (str instanceof ArrayBuffer) str = new Uint8Array(str)
		if (str instanceof Uint8Array) str = String.fromCharCode(...str)
	}
	return btoa(str).replace(/\+/g, '-').replace(/\//g, '_').replace(/=*$/, '')
}
/** Encodes a string or ArrayBuffer as base64url (which differs from base64 at digits 62 and 63 and has no padding)
 * @param {string|Uint8Array|ArrayBuffer} str */
Encodes a string or ArrayBuffer as base64url (which differs from base64 at digits 62 and 63 and has no padding)
@param {string|Uint8Array|ArrayBuffer} str
Encodes a string or ArrayBuffer as base64url ( which differs from base64 at digits 62 and 63 and has no padding ) @param { string|Uint8Array|ArrayBuffer } str
function encode(str) {
	if (typeof str !== 'string') {
		if (str instanceof ArrayBuffer) str = new Uint8Array(str)
		if (str instanceof Uint8Array) str = String.fromCharCode(...str)
	}
	return btoa(str).replace(/\+/g, '-').replace(/\//g, '_').replace(/=*$/, '')
}
function encode ( str ) { if ( typeof str !== 'string' ) { if ( str instanceof ArrayBuffer ) str = new Uint8Array ( str ) if ( str instanceof Uint8Array ) str = String . fromCharCode ( ... str ) } return btoa ( str ) . replace ( / \+ / g , '-' ) . replace ( / \/ / g , '_' ) . replace ( / =*$ / , '' ) }
Encodes a string or ArrayBuffer as base64url (which differs from base64 at digits 62 and 63 and has no padding)
 @param {string|Uint8Array|ArrayBuffer} str
Encodes a string or ArrayBuffer as base64url ( which differs from base64 at digits 62 and 63 and has no padding ) @param { string|Uint8Array|ArrayBuffer } str