mirror of
				https://github.com/bestnite/sub2clash.git
				synced 2025-11-04 04:40:36 +00:00 
			
		
		
		
	Refactor(frontend): Refactor frontend using Lit
Refactor(database): use gorm+sqlite instead of bbolt Feat: Add delete short link functionality Fix: Load correct configuration template during meta config conversion
This commit is contained in:
		
							
								
								
									
										15
									
								
								server/frontend/src/utils.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								server/frontend/src/utils.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
export function base64EncodeUnicode(str: string) {
 | 
			
		||||
  const bytes = new TextEncoder().encode(str);
 | 
			
		||||
  let binary = "";
 | 
			
		||||
  bytes.forEach((b) => (binary += String.fromCharCode(b)));
 | 
			
		||||
  return btoa(binary);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function base64decodeUnicode(str: string) {
 | 
			
		||||
  const binaryString = atob(str);
 | 
			
		||||
  const bytes = new Uint8Array(binaryString.length);
 | 
			
		||||
  for (let i = 0; i < binaryString.length; i++) {
 | 
			
		||||
    bytes[i] = binaryString.charCodeAt(i);
 | 
			
		||||
  }
 | 
			
		||||
  return new TextDecoder().decode(bytes);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user