移動文件
This commit is contained in:
10
暫存/server/lib/crypto.ts
Normal file
10
暫存/server/lib/crypto.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import crypto from 'node:crypto'
|
||||
|
||||
/**
|
||||
* 获取 Sha-256 Hex 格式哈希
|
||||
* @param { crypto.BinaryLike } data
|
||||
* @returns
|
||||
*/
|
||||
export function sha256(data) {
|
||||
return crypto.createHash('sha256').update(data).digest().toString('hex')
|
||||
}
|
||||
Reference in New Issue
Block a user