From 04c30196e709fd2ede552054794930a6e8613905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Thu, 23 Nov 2023 12:28:06 -0600 Subject: [PATCH] Fix linter warnings in BufferUtils --- src/lib/BufferUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/BufferUtils.ts b/src/lib/BufferUtils.ts index a16d0ed0..4dc22aad 100644 --- a/src/lib/BufferUtils.ts +++ b/src/lib/BufferUtils.ts @@ -1,13 +1,13 @@ export function hexToBytes(hex: string) { - return new Uint8Array((hex.match(/.{2}/g) || []).map(byte => parseInt(byte, 16))); + return new Uint8Array((hex.match(/.{2}/g) || []).map((byte) => parseInt(byte, 16))); } export function bytesToHex(bytes: Uint8Array) { const HEX_ALPHABET = '0123456789abcdef'; let hex = ''; - for (let i = 0; i < bytes.length; i++) { - const code = bytes[i]; + for (const code of bytes) { + // tslint:disable:no-bitwise hex += HEX_ALPHABET[code >>> 4]; hex += HEX_ALPHABET[code & 0x0F]; }