extensions/microsoft-authentication/src/cryptoUtils.ts/base64urlencode
function base64urlencode(a: ArrayBuffer) {
	let str = '';
	const bytes = new Uint8Array(a);
	const len = bytes.byteLength;
	for (let i = 0; i < len; i++) {
		str += String.fromCharCode(bytes[i]);
	}
	return base64Encode(str)
		.replace(/\+/g, '-')
		.replace(/\//g, '_')
		.replace(/=+$/, '');
}