mirror of
https://github.com/honojs/hono.git
synced 2024-11-22 02:27:49 +01:00
perf(utils/buffer): use promise all for better performance (#3031)
This commit is contained in:
parent
a9d5313a5a
commit
a9e4176d11
@ -35,8 +35,7 @@ export const timingSafeEqual = async (
|
|||||||
hashFunction = sha256
|
hashFunction = sha256
|
||||||
}
|
}
|
||||||
|
|
||||||
const sa = await hashFunction(a)
|
const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)])
|
||||||
const sb = await hashFunction(b)
|
|
||||||
|
|
||||||
if (!sa || !sb) {
|
if (!sa || !sb) {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user