47 Commits

Author SHA1 Message Date
d7dc85232c feat: Key finder improvement (#1456)
* Improve algorithm

* Updated Documentation in README.md

* Updated Documentation in README.md

* Remove unwanted changes

* Make the changes fit

* Updated Documentation in README.md

---------

Co-authored-by: IcarusTheFly <IcarusTheFly@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-10 12:29:51 +05:30
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-04 02:38:19 +05:30
331a4d26cf feat: Ciphers/MorseCode Algorithm (#1315)
* [feat] New algorithm

* [test] Add new test for ParityOutlier.js

* [fix] Reset indentation

* [fix] Reset indentation

* [fix] Style changes

* fix: improve code efficiency and a glitch

* test: adds a new possible test case

* fix: style fix

* fix: delete redundant comments and else statements

* [fix] style fix

* feat: New algorithm

* fix: fixed custom code symbols

* test: add test for MorseCode

* test: add case with custom code symbols

* delete files from main branch

* fix: style fix

* fix: style fix

* fix: delete unnecessary quotes
2023-05-01 11:47:47 +05:30
002b10a5aa docs: fix typos (#1283)
* docs: fix typos

* fix
2023-02-07 22:20:28 +05:30
907b86c343 Rename to CaesarCipher (#1144) 2022-10-08 19:47:04 +05:30
4b07e8a79a Fix Affine-Cipher encrypt and drypt func (#1077) 2022-08-03 22:33:06 +05:30
7d40bb4a29 merge: Add Affine Cipher (#1067)
* Add Affine Cipher

* Replace IndexOf function to improve performance

* remove leading spacing and fixed typo

* Remove leading spacing in first row.
2022-07-27 17:31:11 +05:30
4cd6fd4f1b merge: Add test case to Vigenere Cipher Algorithm (#1017) 2022-05-17 16:58:00 +05:30
f736217341 merge: Add test case to KeywordShiftedAlphabet algorithm (#1013) 2022-05-12 21:22:30 +05:30
c21ad2ca7a merge: Improved xorCipher (#965)
* feat: improved memoize function

used Map instead of object & used the JSON.stringfy method for generate a valid string as a key

* docs: modified documentation

* style: format with standard

* docs: modified stringify doc

* refactor: remove two repetition implementation

* feat: added validation, test codes

* chore: remove useless words

* feat: added types for jest

* chore: added link box

* feat: added new validation test casses & methods

* style: formated with standard

* feat: added parse method & test cases

* docs: added js docs

* chore: added default import export

* feat: imporved algorithm via replace method

* test: added two test cases

* feat: added jest type for suggestions

* feat: added `reduceRight` & `trim` method

* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.

* remove: yarn lock

* chore: fix grammer

* feat: used replace method & added test case

* feat: remove revert

* chore: added new line
2022-03-29 22:03:26 +05:30
075d35fddb merge: Improved ROT13 function (#964)
* feat: improved memoize function

used Map instead of object & used the JSON.stringfy method for generate a valid string as a key

* docs: modified documentation

* style: format with standard

* docs: modified stringify doc

* refactor: remove two repetition implementation

* feat: added validation, test codes

* chore: remove useless words

* feat: added types for jest

* chore: added link box

* feat: added new validation test casses & methods

* style: formated with standard

* feat: added parse method & test cases

* docs: added js docs

* chore: added default import export

* feat: imporved algorithm via replace method

* test: added two test cases

* feat: added jest type for suggestions

* feat: added `reduceRight` & `trim` method

* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.

* remove: yarn lock

* chore: fix grammer

* feat: remove revert

* chore: added new line
2022-03-29 14:24:21 +05:30
cdfa264b33 merge: Improved CaesarsCipher Algorithm (#963)
* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.
2022-03-29 12:05:58 +05:30
7d57f7f1a7 merge: cache repeated function calls (#962) 2022-03-28 22:19:29 +05:30
1249dbe202 merge: Round-trip testing for Atbash cipher (#958)
- fix the test description
2022-03-28 10:50:16 +05:30
47c1c51bc9 merge: Improved ciphers (#954)
* feat: imporved algorithm via replace method

* test: added two test cases
2022-03-27 22:45:14 +05:30
df4a783b06 Complying with JavaScript Standard Style (npx standard --fix). 2021-10-11 15:49:24 +02:00
e18718b7d5 Remove live code & console.log, leave examples as comments. 2021-10-11 14:07:10 +02:00
5c4be7604d Remove live code & console.log (Backtracking, Bit-manipulation, Ciphers). 2021-10-09 17:47:03 +02:00
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
459a7756a3 Merge pull request #317 from aryabharat/master
Create AtBash.js
2021-05-23 14:33:36 +05:30
ebf975b0fb Merge pull request #355 from bambusekd/cipher-keyword-shifted-alphabet
Cipher keyword shifted alphabet
2021-05-23 13:14:03 +05:30
0ca9c89727 Add ROT13 cipher (#463)
* Add ROT13 cipher

* Update ROT13.js

Co-authored-by: Sutthinart Khunvadhana <sutthinart.khunvadhana@refinitiv.com>
Co-authored-by: vinayak <itssvinayak@gmail.com>
2020-10-12 13:05:09 +05:30
985e193ab7 Update Atbash.js 2020-10-03 15:36:23 +05:30
5023cdd7cc Update Atbash.js 2020-10-03 15:23:24 +05:30
4a8443dda8 Update and rename AtBash.js to Atbash.js 2020-10-03 11:56:12 +05:30
72d556ace2 Add new Cipher > Keyword Shifted Alphabet 2020-10-02 12:23:41 +02:00
c2769cd63d Add new Cipher > Keyword Shifted Alphabet 2020-10-02 12:16:28 +02:00
23d1bfda28 Update AtBash.js 2020-10-01 23:54:44 +05:30
4f19129a69 Create AtBash.js 2020-10-01 13:18:18 +05:30
4be7a85fd3 Added an XOR cipher (#135)
* Added an XOR cipher

* Rename xor_cipher.js to XORCipher.js

* Update XORCipher.js

Co-authored-by: vinayak <itssvinayak@gmail.com>
2020-06-23 10:17:44 +05:30
670edfc9aa Renaming files according to naming convention (#158) 2020-05-08 17:54:19 +05:30
2e0bd65b0c Fixing non compliant files (Ciphers, Conversions and Data Structures) 2020-05-03 21:26:52 -03:00
856dc2f63c npx standard --fix 2020-05-03 09:05:12 +02:00
f37cac8508 Fixed Whitespace, Operators, and Quotes to Comply with JSLint
I modified the whitespace in the files and changed single quotes to double quotes.

I also changed some `==` and `!=` operators to `===` and `!==` to comply with JSLint.
2019-06-27 10:41:44 -04:00
2445600a53 Update keyFinder.js
Add some key words to the wordbank to increase the chance of the matching.
2018-10-31 17:08:24 +08:00
75d7ef53dc Update keyFinder.js
Finally, there are several changes in the function keyFinder(str) that make it works well
2018-10-31 16:54:20 +08:00
fed5d517fd Update keyFinder.js
a sub-function is used to assist the keyfinder to find the key
2018-10-31 10:36:52 +08:00
a93d5cfe67 Update keyFinder.js
1. modified the identifiers and used the suitable identifiers for the variables
2. leave the loop when a key is match and found to increase the speed of searching in this stage of development
3. return the key number if founded, return 0 if found nothing
2018-10-31 10:10:17 +08:00
6c894a2aa5 Update keyFinder.js
modified used the suitable identifier for the variables
2018-10-31 09:47:06 +08:00
7a04d2ad86 Update keyFinder.js
Made 2 changes to optimize the match results:
1. use a loop to find the next digit of wordbank element and compare with outStr's digit
2. this part need to be optimize with the calculation of the number of occurance of word's probabilities
2018-10-30 11:20:32 +08:00
e41ad76298 Update keyFinder.js
some changes is made to optimize the function
2018-10-27 12:29:36 +08:00
e0fa99b2fd Update keyFinder.js
optimized the indentation for the if statement in line 18
2018-10-27 11:13:15 +08:00
5a75bcae52 Rename keyFinder to keyFinder.js 2018-10-27 10:38:07 +08:00
633105633b Create keyFinder
Find and retrieve the encryption key automatically 
Note: This is a draft version, please help to modify, Thanks!
2018-10-25 20:15:11 +08:00
8281dacdfc Create vigenereCipher.js
I translate this code from Java repository to Javascript language. Could be improved.
2018-09-29 22:02:08 -05:00
bceb750f76 removed switch construct and put in a if-construct. 2018-03-30 16:16:12 +02:00
2fd39c88ff Adding the Caesar's Cipher algorithm 2017-10-15 17:07:44 -04:00