File tree 1 file changed +0
-13
lines changed
1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -68,19 +68,6 @@ export const stringifyUUID = (arr: Uint8Array, offset = 0): string => {
68
68
) . toLowerCase ( ) ;
69
69
} ;
70
70
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
-
84
71
export const decrypt = ( token : string , key : string ) : string => {
85
72
const binKey = parseUUID ( key ) ;
86
73
if ( binKey . length !== 16 ) {
You can’t perform that action at this time.
0 commit comments