chore: add theme hash checking and alerts

This commit is contained in:
HorizonCode committed 2026-05-08 18:03:26 +02:00
1 parent 7f65384b1c
commit 4326199a56
5 files changed
+119 -21

No files matched your search

+8
View File
@@ -2,6 +2,7 @@ import { invoke } from '@tauri-apps/api/core';
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { custom_theme_audio_playing } from './global';
import * as crypto from 'crypto-js';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
@@ -201,3 +202,10 @@ export function trackMediaContainer(node: HTMLElement) {
},
};
}
export function calculateGitBlobSha(fileBuffer: Buffer): string {
const header = Buffer.from(`blob ${fileBuffer.length}\0`);
const store = Buffer.concat([header, fileBuffer]);
return crypto.SHA1(crypto.lib.WordArray.create(store)).toString(crypto.enc.Hex);
}