mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
Fix typos in Caesar Cipher.
This commit is contained in:
parent
0879d79bfb
commit
8bfec64edc
|
@ -22,7 +22,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[Bitcoin price GUI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) |
|
|[Bitcoin price GUI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) |
|
||||||
|[Cryptocurrency Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) |
|
|[Cryptocurrency Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) |
|
||||||
|[Cryptocurrency Prices](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-Prices) |[xemeds](https://github.com/xemeds) |
|
|[Cryptocurrency Prices](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-Prices) |[xemeds](https://github.com/xemeds) |
|
||||||
|[Caesar Cipher](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/caeser_cipher) |[epi052](https://github.com/epi052) |
|
|[Caesar Cipher](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/caesar_cipher) |[epi052](https://github.com/epi052) |
|
||||||
|[Checksum tool](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Checksum) |[Austin Ewens](https://github.com/aewens) |
|
|[Checksum tool](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Checksum) |[Austin Ewens](https://github.com/aewens) |
|
||||||
|[Codechef autosubmitter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) |
|
|[Codechef autosubmitter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) |
|
||||||
|[Colored B&W Image Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) |
|
|[Colored B&W Image Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) |
|
||||||
|
@ -100,7 +100,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[Asymmetric Encryption](asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) |
|
|[Asymmetric Encryption](asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) |
|
||||||
|[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) |
|
|[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) |
|
||||||
|[Cryptocurrency Converter](Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) |
|
|[Cryptocurrency Converter](Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) |
|
||||||
|[Caesar Cipher](caeser_cipher) |[epi052](https://github.com/epi052) |
|
|[Caesar Cipher](caesar_cipher) |[epi052](https://github.com/epi052) |
|
||||||
|[Checksum tool](Checksum) |[Austin Ewens](https://github.com/aewens) |
|
|[Checksum tool](Checksum) |[Austin Ewens](https://github.com/aewens) |
|
||||||
|[Codechef autosubmitter](Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) |
|
|[Codechef autosubmitter](Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) |
|
||||||
|[Colored B&W Image Converter](Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) |
|
|[Colored B&W Image Converter](Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) |
|
||||||
|
|
27
caesar_cipher/README.md
Normal file
27
caesar_cipher/README.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# Simple caesar Cipher [En,De]coder
|
||||||
|
|
||||||
|
A simple implementation of a CLI tool to work with caesar ciphers. The default implementation is ROT-13, but can be
|
||||||
|
adjusted for any offset. Works on files and string arguments passed via CLI.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 caesar.py
|
||||||
|
|
||||||
|
usage: caesar.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING)
|
||||||
|
caesar.py: error: one of the arguments -f/--file -s/--string is required
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 caesar.py -s "have you tried turning it off and on again?"
|
||||||
|
unir lbh gevrq gheavat vg bss naq ba ntnva?
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 caesar.py -d -s "unir lbh gevrq gheavat vg bss naq ba ntnva?"
|
||||||
|
have you tried turning it off and on again?
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 caesar.py -s "have you tried turning it off and on again?" -o -4
|
||||||
|
dwra ukq pneaz pqnjejc ep kbb wjz kj wcwej?
|
||||||
|
```
|
||||||
|
|
|
@ -9,8 +9,8 @@ except AttributeError:
|
||||||
maketrans = str.maketrans # python3
|
maketrans = str.maketrans # python3
|
||||||
|
|
||||||
|
|
||||||
def caeser_cipher(string_: str, offset: int, decode: bool, file_: string) -> None:
|
def caesar_cipher(string_: str, offset: int, decode: bool, file_: string) -> None:
|
||||||
""" Caeser Cipher implementation, reads file or string. Also decodes.
|
""" caesar Cipher implementation, reads file or string. Also decodes.
|
||||||
|
|
||||||
Default implementation is ROT13 encoding.
|
Default implementation is ROT13 encoding.
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ def check_offset_range(value: int) -> int:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description="Simple Caeser Cipher [En,De]coder")
|
parser = argparse.ArgumentParser(description="Simple caesar Cipher [En,De]coder")
|
||||||
|
|
||||||
parser.add_argument('-d', '--decode', action='store_true', dest='decode',
|
parser.add_argument('-d', '--decode', action='store_true', dest='decode',
|
||||||
help='decode ciphertext (offset should equal what was used to encode)', default=False)
|
help='decode ciphertext (offset should equal what was used to encode)', default=False)
|
||||||
|
@ -72,4 +72,4 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
caeser_cipher(args.string, args.offset, args.decode, args.file)
|
caesar_cipher(args.string, args.offset, args.decode, args.file)
|
|
@ -1,27 +0,0 @@
|
||||||
# Simple Caeser Cipher [En,De]coder
|
|
||||||
|
|
||||||
A simple implementation of a CLI tool to work with caeser ciphers. The default implementation is ROT-13, but can be
|
|
||||||
adjusted for any offset. Works on files and string arguments passed via CLI.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 caeser.py
|
|
||||||
|
|
||||||
usage: caeser.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING)
|
|
||||||
caeser.py: error: one of the arguments -f/--file -s/--string is required
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 caeser.py -s "have you tried turning it off and on again?"
|
|
||||||
unir lbh gevrq gheavat vg bss naq ba ntnva?
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 caeser.py -d -s "unir lbh gevrq gheavat vg bss naq ba ntnva?"
|
|
||||||
have you tried turning it off and on again?
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 caeser.py -s "have you tried turning it off and on again?" -o -4
|
|
||||||
dwra ukq pneaz pqnjejc ep kbb wjz kj wcwej?
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user