报告创建请求、校正入口和同名类型改从 contracts 推导;同义的对象判断与 sha256 改走共享函数。调用处用 import 别名保留原名,使 diff 低于 1500 行。行为、哈希和状态字符串不变。 Co-Authored-By: Grok (agent loop)
10 lines
289 B
TypeScript
10 lines
289 B
TypeScript
/**
|
|
* SHA-256 hex digest.
|
|
* Imports node:crypto. Server modules only — do not import this file from client components.
|
|
*/
|
|
import { createHash } from "node:crypto";
|
|
|
|
export function sha256Hex(text: string): string {
|
|
return createHash("sha256").update(text).digest("hex");
|
|
}
|