Skip to content

Commit

Permalink
random uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
r58Playz committed Dec 21, 2024
1 parent 7267c6c commit 1bbcd10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ export interface CapeInfo extends AccessoryInfo {
alias: string;
}

// https://github.com/MercuryWorkshop/epoxy-tls/blob/7ce772da7de828d61b26e13a51ae1c32a8ff913d/client/src/utils/js.rs#L19-L24
function randomUUID() {
return (
/* @ts-ignore */
[1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g,
c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}

async function xboxAuth(msToken: string): Promise<string> {
const res = await fetch("https://user.auth.xboxlive.com/user/authenticate", {
headers: {
Expand Down

0 comments on commit 1bbcd10

Please sign in to comment.