From 03969051a4189d7e32100d7bf22c4f41822d6239 Mon Sep 17 00:00:00 2001 From: Bit Borealis Date: Fri, 12 Aug 2022 01:54:01 +0000 Subject: [PATCH] remove unnecesary const from parse and added comment to binarytoarray --- src/parse.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/parse.ts b/src/parse.ts index a0f4af4..84dd1fd 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -1,10 +1,3 @@ -const baseUrl: string = "https://envs.sh" -const id: string = "QnK" // < unicode > -const key: string = "LhBRttf+oI/PNHyTBrPa7HGDK/uC9fcMkGGgz63zT4Y=" // 32 bytes b64 -const completeUrl: string = baseUrl + "/" + id + ".bin#" + key -console.log(completeUrl); -const urlObj:URL = new URL(completeUrl); - /** will return a tuple of the key and id if valid * 1 if no id ( creator ) * 2 if encryption key is missing / wrong length @@ -30,6 +23,9 @@ function validUrl(url: URL): [string,Uint8Array] | number { } } +/** + * will convert a binary string to a Uint8Array + */ function binaryToArray(raw: string): Uint8Array { var rawLength = raw.length; var array = new Uint8Array(new ArrayBuffer(rawLength)); @@ -39,5 +35,3 @@ function binaryToArray(raw: string): Uint8Array { } return array; } - -console.log(validUrl(urlObj));