12 lines
260 B
TypeScript
12 lines
260 B
TypeScript
import { createHash } from "node:crypto";
|
|
|
|
import { serverEnv } from "./env";
|
|
|
|
export function privacyHash(value: string): string {
|
|
return createHash("sha256")
|
|
.update(serverEnv().rateLimitSalt)
|
|
.update("\0")
|
|
.update(value)
|
|
.digest("hex");
|
|
}
|