chore: remove unsued code (#5749)

This commit is contained in:
Alex Yang
2025-11-03 21:40:31 -08:00
committed by GitHub
parent 324a2ed343
commit a09147f53c
2 changed files with 0 additions and 22 deletions

View File

@@ -1,21 +0,0 @@
import { base64 } from "@better-auth/utils/base64";
import { createHash } from "@better-auth/utils/hash";
import { constantTimeEqual } from "./buffer";
export async function hashToBase64(
data: string | ArrayBuffer,
): Promise<string> {
const buffer = await createHash("SHA-256").digest(data);
return base64.encode(buffer);
}
export async function compareHash(
data: string | ArrayBuffer,
hash: string,
): Promise<boolean> {
const buffer = await createHash("SHA-256").digest(
typeof data === "string" ? new TextEncoder().encode(data) : data,
);
const hashBuffer = base64.decode(hash);
return constantTimeEqual(buffer, hashBuffer);
}

View File

@@ -38,7 +38,6 @@ export const symmetricDecrypt = async ({
};
export * from "./buffer";
export * from "./hash";
export * from "./jwt";
export * from "./password";
export * from "./random";