Optimize Caesar Cipher Implementation and Enhance Robustness
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- cryptography
Direzione di ricerca
Start by locating the Caesar cipher implementation and its getCipherMap function. Review how encryption and decryption currently handle the input, then verify that the optimization, invalid-input checks, and case preservation apply consistently to both operations. Done means the requested behavior is implemented without changing correct cipher behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description:
The current Caesar cipher implementation works correctly for both encryption and decryption, but there are opportunities for optimization and added functionality:
Optimization: The getCipherMap function unnecessarily clones the charsMap object in every iteration, which can be simplified by directly updating the existing object.
Robustness: There are no checks for invalid inputs, such as non-string data types or empty strings. Adding input validation will make the functions more reliable.
Preserve Case: The cipher converts all characters to lowercase, losing the original case. Enhancing the logic to preserve the case would improve usability.
Suggested Fix:
Optimize the reduce method by removing redundant cloning.
Add input validation checks.
Implement case-sensitive encryption and decryption.
- Lingua principale
- JavaScript
- Stelle
- 197k
- Fork
- 31k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di trekhleb/javascript-algorithms
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
trekhleb/javascript-algorithms#2102 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
trekhleb/javascript-algorithms#2085 · 6 commenti · 1 reazione ·
-
LinkedList methods. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
trekhleb/javascript-algorithms#2065 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
trekhleb/javascript-algorithms#2057 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
trekhleb/javascript-algorithms#2056 ·
Tutte le issue di trekhleb/javascript-algorithms
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
matrix-org/matrix.org#3649 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vadimdemedes/ink#1029 ·