0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-22 11:17:33 +01:00

perf(utils/buffer): use promise all for better performance (#3031)

This commit is contained in:
yasuaki640 2024-06-25 06:18:37 +09:00 committed by GitHub
parent a9d5313a5a
commit a9e4176d11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,8 +35,7 @@ export const timingSafeEqual = async (
hashFunction = sha256
}
const sa = await hashFunction(a)
const sb = await hashFunction(b)
const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)])
if (!sa || !sb) {
return false