Skip to content

Commit

Permalink
perf: call toLowerCase in initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU committed Jan 11, 2023
1 parent 62ef29e commit 26d9601
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import validate from './validate.js';
const byteToHex = [];

for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
byteToHex.push((i + 0x100).toString(16).slice(1).toLowerCase());
}

export function unsafeStringify(arr, offset = 0) {
Expand All @@ -34,7 +34,7 @@ export function unsafeStringify(arr, offset = 0) {
byteToHex[arr[offset + 13]] +
byteToHex[arr[offset + 14]] +
byteToHex[arr[offset + 15]]
).toLowerCase();
);
}

function stringify(arr, offset = 0) {
Expand Down

0 comments on commit 26d9601

Please sign in to comment.