diff --git a/.build/img/QuasiEntropy.png b/.build/img/QuasiEntropy.png deleted file mode 100644 index ab25bdf..0000000 Binary files a/.build/img/QuasiEntropy.png and /dev/null differ diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 99f2fa2..141168d 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -23,8 +23,7 @@ jobs: uses: actions/checkout@v2 - name: Setup Deno - # uses: denoland/setup-deno@v1 - uses: denoland/setup-deno@004814556e37c54a2f6e31384c9e18e9833173669 + uses: denoland/setup-deno@v1 with: deno-version: v1.x diff --git a/.idea/deno.xml b/.idea/deno.xml new file mode 100644 index 0000000..b03feb5 --- /dev/null +++ b/.idea/deno.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/README.md b/README.md index dde4fe9..2b9ff99 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,3 @@ The Little CryptoSuite that could. ```shell deno test src/ ``` -![img.png](.build/img/QuasiEntropy.png) diff --git a/deno.json b/deno.json index 9e9850e..fc1d99e 100644 --- a/deno.json +++ b/deno.json @@ -15,4 +15,4 @@ "exclude": ["no-unused-vars"] } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 9228057..4416526 100644 --- a/package.json +++ b/package.json @@ -6,38 +6,20 @@ "homepage": "https://github.com/Snider/enchantrix/wiki", "bugs": { "url": "https://github.com/Snider/enchantrix/issues", - "email": "snider@lt.hn" + "email": "secops@lt.hn" }, - "author": "Snider (https://lt.hn)", - "main": "src/server.ts", + "author": "Snider ", "repository": { "type": "git", "url": "https://github.com/Snider/enchantrix" }, "scripts": { "dev": "deno run --watch --allow-net --allow-env --allow-run --allow-read --allow-write --unstable src/server.ts", - "lint": "eslint 'src/**/*.{ts,html,scss}' --cache", - "test": "deno test src/ ", - "sdk:angular": "openapi-generator generate -i openapi.json -g typescript-angular -o build/api" + "lint": "deno lint src/", + "test": "deno test src/" }, "dependencies": { - "ansi_up": "^5.1.0", - "ansi-to-html": "^0.7.2", - "ansicolor": "^1.1.95", - "axios": "^0.24.0", - "i": "^0.3.7", - "npm": "^8.1.2", "openpgp": "^5.0.0", - "pem-ts": "^3.0.0", - "swagger-jsdoc": "^6.1.0" - }, - "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.4.18", - "@typescript-eslint/eslint-plugin": "^5.4.0", - "@typescript-eslint/parser": "^5.4.0", - "eslint": "^8.3.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0", - "prettier": "^2.4.1" + "pem-ts": "^3.0.0" } } diff --git a/src/salt/quasi-entropy.ts b/src/salt/quasi-entropy.ts index 680f570..38f9aa3 100644 --- a/src/salt/quasi-entropy.ts +++ b/src/salt/quasi-entropy.ts @@ -10,7 +10,8 @@ export class EnchantrixSaltQuasiEntropy { * * @protected */ - protected charMap = { + // deno-lint-ignore no-explicit-any + protected charMap:any = { ' ': '', 'o': '0', 'l': "1", @@ -20,10 +21,14 @@ export class EnchantrixSaltQuasiEntropy { 't': "7", } + /** + * @type {string} Origin Input + * @protected + */ protected readonly _input: string = '' /** - * Supply the input + * Initiate with input to work on * * @param input */ @@ -31,27 +36,36 @@ export class EnchantrixSaltQuasiEntropy { this._input = input } + /** + * Returns CharMap + * + * @returns {{'[char]': string}} + */ + // deno-lint-ignore no-explicit-any get keyMap():any { return this.charMap } /** + * Performs salt on input * - * @param {string} input - * @returns {string} + * @returns {string} Salted Input */ salty(): string { if (!this._input) { return ''; } - let i: number = this._input.length; - let salt:string[] = [] + let i: number = this._input.length + + const salt:string[] = [] + while (i--) { - salt.push(this.keyMap[this._input[i]] !== undefined ? this.keyMap[this._input[i]] : this._input[i]); + // If Char is in the map, use the replaced value; otherwise use original char + salt.push(this.keyMap[this._input[i]] !== undefined ? this.keyMap[this._input[i]] : this._input[i]) } - return salt.join(''); + return salt.join('') } }