aboutsummaryrefslogtreecommitdiffstats
path: root/tests/runner/browserstack/createAuthHeader.js
blob: fe4831e9ae622069e355938eb8179592d79150d6 (plain)
1
2
3
4
5
6
7
const textEncoder = new TextEncoder();

export function createAuthHeader( username, accessKey ) {
	const encoded = textEncoder.encode( `${ username }:${ accessKey }` );
	const base64 = btoa( String.fromCodePoint.apply( null, encoded ) );
	return `Basic ${ base64 }`;
}