refactor: extract shared util package (#37828)
This commit is contained in:
parent
7243bd9e12
commit
e0810753f2
272 changed files with 590 additions and 565 deletions
11
packages/util/src/hash.ts
Normal file
11
packages/util/src/hash.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { createHash } from "crypto"
|
||||
|
||||
export namespace Hash {
|
||||
export function fast(input: string | Buffer): string {
|
||||
return createHash("sha1").update(input).digest("hex")
|
||||
}
|
||||
|
||||
export function sha256(input: string | Buffer): string {
|
||||
return createHash("sha256").update(input).digest("hex")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue