mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
Update keyFinder.js
Add some key words to the wordbank to increase the chance of the matching.
This commit is contained in:
@ -3,7 +3,7 @@ Find and retrieve the encryption key automatically
|
||||
Note: This is a draft version, please help to modify, Thanks!
|
||||
******************************************************/
|
||||
function keyFinder(str){ // str is used to get the input of encrypted string
|
||||
const wordbank =[" the ","The "," of "," is ","Is "," am ","Am "," are ","Are "," have ","Have "," has ","Has "," may ","May "," be ","Be "];
|
||||
const wordbank =["I ","You ","We ","They ","He ","She ","It "," the ","The "," of "," is ","Is "," am ","Am "," are ","Are "," have ","Have "," has ","Has "," may ","May "," be ","Be "];
|
||||
//let wordbankelementCounter = 0;
|
||||
//let key = 0; // return zero means the key can not be found
|
||||
let inStr = str.toString(); //convert the input to String
|
||||
|
Reference in New Issue
Block a user