From db40030a4f6bd841640f91aff7598d4ac1d37879 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 21 Oct 2022 19:40:24 +1100 Subject: [PATCH] chore(uuid): cleanup unused internal functions (#2797) --- uuid/_common.ts | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/uuid/_common.ts b/uuid/_common.ts index 895f44ec9..582b65ca4 100644 --- a/uuid/_common.ts +++ b/uuid/_common.ts @@ -37,29 +37,3 @@ export function uuidToBytes(uuid: string): number[] { return bytes; } - -/** - * Converts a string to a byte array using the char code. - * @param str Value that gets converted. - */ -export function stringToBytes(str: string): number[] { - str = unescape(encodeURIComponent(str)); - const bytes = Array.from({ length: str.length }); - for (let i = 0; i < str.length; i++) { - bytes[i] = str.charCodeAt(i); - } - return bytes; -} - -/** - * Creates a buffer for creating a SHA-1 hash. - * @param content Buffer for SHA-1 hash. - */ -export function createBuffer(content: number[]): ArrayBuffer { - const arrayBuffer = new ArrayBuffer(content.length); - const uint8Array = new Uint8Array(arrayBuffer); - for (let i = 0; i < content.length; i++) { - uint8Array[i] = content[i]; - } - return arrayBuffer; -}