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));