jquery-ui/tests/runner/browserstack/createAuthHeader.js
2024-04-09 13:31:27 -04:00

8 lines
269 B
JavaScript

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 }`;
}