From a964d2d3f02aa2cdee442febb735cbe91364e54a Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:03:00 +0000 Subject: [PATCH] chore(middleware-flexible-checksums): re-order checksum implementations based on performance --- packages/middleware-flexible-checksums/src/types.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/middleware-flexible-checksums/src/types.ts b/packages/middleware-flexible-checksums/src/types.ts index 0b768a74e57db..f3fe77892318f 100644 --- a/packages/middleware-flexible-checksums/src/types.ts +++ b/packages/middleware-flexible-checksums/src/types.ts @@ -12,11 +12,10 @@ export const CLIENT_SUPPORTED_ALGORITHMS = [ /** * Priority order for validating checksum algorithm. A faster algorithm has higher priority. - * ToDo: update the priority order based on profiling of JavaScript implementations. */ export const PRIORITY_ORDER_ALGORITHMS = [ + ChecksumAlgorithm.SHA256, + ChecksumAlgorithm.SHA1, ChecksumAlgorithm.CRC32, ChecksumAlgorithm.CRC32C, - ChecksumAlgorithm.SHA1, - ChecksumAlgorithm.SHA256, ];