0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 10:08:58 +01:00

fix(utils/crypto): fix types of crypto utility (#3614)

* fix(utils/crypto): fix types of crypto utility

* fix lint
This commit is contained in:
EdamAmex 2024-11-04 14:03:47 +09:00 committed by GitHub
parent 22db73f461
commit d717a4fabf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,12 +3,14 @@
* Crypto utility.
*/
import type { JSONValue } from './types'
type Algorithm = {
name: string
alias: string
}
type Data = string | boolean | number | object | ArrayBufferView | ArrayBuffer
type Data = string | boolean | number | JSONValue | ArrayBufferView | ArrayBuffer
export const sha256 = async (data: Data): Promise<string | null> => {
const algorithm: Algorithm = { name: 'SHA-256', alias: 'sha256' }