mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-23 01:24:22 +00:00
4af5caed7a
Close gh-2234
8 lines
269 B
JavaScript
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 }`;
|
|
}
|