Clean up
This commit is contained in:
parent
9ce645883d
commit
35e2ad4e9e
7 changed files with 35 additions and 35 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
3
.github/workflows/deno.yml
vendored
3
.github/workflows/deno.yml
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
6
.idea/deno.xml
generated
Normal file
6
.idea/deno.xml
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DenoSettings">
|
||||
<option name="useDeno" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -5,4 +5,3 @@ The Little CryptoSuite that could.
|
|||
```shell
|
||||
deno test src/
|
||||
```
|
||||

|
||||
|
|
|
|||
|
|
@ -15,4 +15,4 @@
|
|||
"exclude": ["no-unused-vars"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
28
package.json
28
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 <snider@lt.hn> (https://lt.hn)",
|
||||
"main": "src/server.ts",
|
||||
"author": "Snider <snider@lthn>",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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('')
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue