text-encrypter
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -17,2 +17,9 @@ # CHANGELOG | ||
## v1.1.0 | ||
#### Performance Improvements | ||
- Structural improvements | ||
- Performance improvements | ||
## v1.0.0 | ||
@@ -19,0 +26,0 @@ |
@@ -1,2 +0,2 @@ | ||
const r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e=(e,t=1,o=!0)=>{let n,i=[];return e.split("").map(e=>{o&&(e=r.includes(e.toLowerCase())?e:" ");let s=e.charCodeAt(e);return" "===e?i.push(e):(s>=65&&s<=90?n=String.fromCharCode((s-65+t)%26+65):s>=97&&s<=122&&(n=String.fromCharCode((s-97+t)%26+97)),i.push(n))}),i.join("")},t=(e,t=1,o=!0)=>{let n,i=[];return e.split("").map(e=>{o&&(e=r.includes(e.toLowerCase())?e:" ");let s=e.charCodeAt(e);if(" "===e)return i.push(e);if(s>=65&&s<=90){let r=s-65-t;n=String.fromCharCode(r>=0?r%26+65:(26+r)%26+65)}else if(s>=97&&s<=122){let r=s-97-t;n=String.fromCharCode(r>=0?r%26+97:(26+r)%26+97)}return i.push(n)}),i.join("")};export{t as decrypt,e as encrypt}; | ||
const r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t=(t,o=1,e=!0)=>{const n=[];let s;return t.split("").map(t=>{e&&(t=r.includes(t.toLowerCase())?t:" ");const i=t.charCodeAt(0);return" "===t?n.push(t):(i>=65&&i<=90?s=String.fromCharCode((i-65+o)%26+65):i>=97&&i<=122&&(s=String.fromCharCode((i-97+o)%26+97)),n.push(s))}),n.join("")},o=(t,o=1,e=!0)=>{const n=[];let s;return t.split("").map(t=>{e&&(t=r.includes(t.toLowerCase())?t:" ");const i=t.charCodeAt(0);if(" "===t)return n.push(t);if(i>=65&&i<=90){const r=i-65-o;s=String.fromCharCode(r>=0?r%26+65:(26+r)%26+65)}else if(i>=97&&i<=122){const r=i-97-o;s=String.fromCharCode(r>=0?r%26+97:(26+r)%26+97)}return n.push(s)}),n.join("")};export{o as decrypt,t as encrypt}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
var r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],o=function(o,i,n){void 0===i&&(i=1),void 0===n&&(n=!0);var e,t=[];return o.split("").map(function(o){n&&(o=r.includes(o.toLowerCase())?o:" ");var a=o.charCodeAt(o);return" "===o?t.push(o):(a>=65&&a<=90?e=String.fromCharCode((a-65+i)%26+65):a>=97&&a<=122&&(e=String.fromCharCode((a-97+i)%26+97)),t.push(e))}),t.join("")},i=function(o,i,n){void 0===i&&(i=1),void 0===n&&(n=!0);var e,t=[];return o.split("").map(function(o){n&&(o=r.includes(o.toLowerCase())?o:" ");var a=o.charCodeAt(o);if(" "===o)return t.push(o);if(a>=65&&a<=90){var u=a-65-i;e=String.fromCharCode(u>=0?u%26+65:(26+u)%26+65)}else if(a>=97&&a<=122){var d=a-97-i;e=String.fromCharCode(d>=0?d%26+97:(26+d)%26+97)}return t.push(e)}),t.join("")};export{i as decrypt,o as encrypt}; | ||
var r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],o=function(o,i,n){void 0===i&&(i=1),void 0===n&&(n=!0);var e,t=[];return o.split("").map(function(o){n&&(o=r.includes(o.toLowerCase())?o:" ");var a=o.charCodeAt(0);return" "===o?t.push(o):(a>=65&&a<=90?e=String.fromCharCode((a-65+i)%26+65):a>=97&&a<=122&&(e=String.fromCharCode((a-97+i)%26+97)),t.push(e))}),t.join("")},i=function(o,i,n){void 0===i&&(i=1),void 0===n&&(n=!0);var e,t=[];return o.split("").map(function(o){n&&(o=r.includes(o.toLowerCase())?o:" ");var a=o.charCodeAt(0);if(" "===o)return t.push(o);if(a>=65&&a<=90){var u=a-65-i;e=String.fromCharCode(u>=0?u%26+65:(26+u)%26+65)}else if(a>=97&&a<=122){var d=a-97-i;e=String.fromCharCode(d>=0?d%26+97:(26+d)%26+97)}return t.push(e)}),t.join("")};export{i as decrypt,o as encrypt}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e||self).textEncrypter={})}(this,function(e){var r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];e.decrypt=function(e,o,n){void 0===o&&(o=1),void 0===n&&(n=!0);var t,i=[];return e.split("").map(function(e){n&&(e=r.includes(e.toLowerCase())?e:" ");var f=e.charCodeAt(e);if(" "===e)return i.push(e);if(f>=65&&f<=90){var d=f-65-o;t=String.fromCharCode(d>=0?d%26+65:(26+d)%26+65)}else if(f>=97&&f<=122){var u=f-97-o;t=String.fromCharCode(u>=0?u%26+97:(26+u)%26+97)}return i.push(t)}),i.join("")},e.encrypt=function(e,o,n){void 0===o&&(o=1),void 0===n&&(n=!0);var t,i=[];return e.split("").map(function(e){n&&(e=r.includes(e.toLowerCase())?e:" ");var f=e.charCodeAt(e);return" "===e?i.push(e):(f>=65&&f<=90?t=String.fromCharCode((f-65+o)%26+65):f>=97&&f<=122&&(t=String.fromCharCode((f-97+o)%26+97)),i.push(t))}),i.join("")}}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e||self).textEncrypter={})}(this,function(e){var r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];e.decrypt=function(e,o,n){void 0===o&&(o=1),void 0===n&&(n=!0);var t,i=[];return e.split("").map(function(e){n&&(e=r.includes(e.toLowerCase())?e:" ");var f=e.charCodeAt(0);if(" "===e)return i.push(e);if(f>=65&&f<=90){var d=f-65-o;t=String.fromCharCode(d>=0?d%26+65:(26+d)%26+65)}else if(f>=97&&f<=122){var u=f-97-o;t=String.fromCharCode(u>=0?u%26+97:(26+u)%26+97)}return i.push(t)}),i.join("")},e.encrypt=function(e,o,n){void 0===o&&(o=1),void 0===n&&(n=!0);var t,i=[];return e.split("").map(function(e){n&&(e=r.includes(e.toLowerCase())?e:" ");var f=e.charCodeAt(0);return" "===e?i.push(e):(f>=65&&f<=90?t=String.fromCharCode((f-65+o)%26+65):f>=97&&f<=122&&(t=String.fromCharCode((f-97+o)%26+97)),i.push(t))}),i.join("")}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "text-encrypter", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "The library to encrypt/decrypt text using caesar cipher mechanism", | ||
"type": "module", | ||
"source": "src/index.js", | ||
"source": "src/index.ts", | ||
"exports": { | ||
@@ -14,8 +14,9 @@ "require": "./dist/index.cjs", | ||
"unpkg": "./dist/index.umd.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "microbundle", | ||
"build": "rm -rf ./dist && microbundle --tsconfig ./tsconfig.json", | ||
"dev": "microbundle watch", | ||
"prepare": "husky install", | ||
"lint": "eslint src test", | ||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" | ||
"test": "jest" | ||
}, | ||
@@ -50,4 +51,12 @@ "repository": { | ||
"prettier": "^2.7.1", | ||
"pretty-quick": "^3.1.3" | ||
"pretty-quick": "^3.1.3", | ||
"@types/jest": "^29.2.5", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
"eslint-config-standard-with-typescript": "^24.0.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
"eslint-plugin-n": "^15.0.0", | ||
"eslint-plugin-promise": "^6.0.0", | ||
"ts-jest": "^29.0.3", | ||
"typescript": "*" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32731
32
93
19