Skip to content

Commit 3d01ac7

Browse files
committed
Remove obsolete encrypt function
1 parent 5bd1f52 commit 3d01ac7

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

crypto.ts

-13
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ export const stringifyUUID = (arr: Uint8Array, offset = 0): string => {
6868
).toLowerCase();
6969
};
7070

71-
export const encrypt = (token: string, key: string): string => {
72-
const binKey = parseUUID(key);
73-
const missingChars = 36 - token.length; // Pad for valid UUID length
74-
const padded = token + "0".repeat(missingChars);
75-
if (binKey.length !== 16) {
76-
throw new Error(`Invalid key length: ${binKey.length}`);
77-
}
78-
const xored = new Uint8Array(17);
79-
parseUUID(padded).forEach((x, i) => (xored[i] = x ^ binKey[i]));
80-
xored[16] = crc8(xored.subarray(0, 16));
81-
return btoa(String.fromCharCode(...xored));
82-
};
83-
8471
export const decrypt = (token: string, key: string): string => {
8572
const binKey = parseUUID(key);
8673
if (binKey.length !== 16) {

0 commit comments

Comments
 (0)