mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 09:32:20 -05:00
chore: remove unsued code (#5749)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -38,7 +38,6 @@ export const symmetricDecrypt = async ({
|
||||
};
|
||||
|
||||
export * from "./buffer";
|
||||
export * from "./hash";
|
||||
export * from "./jwt";
|
||||
export * from "./password";
|
||||
export * from "./random";
|
||||
|
||||
Reference in New Issue
Block a user