diff --git a/README.md b/README.md index 2027e1b..df14cfb 100644 --- a/README.md +++ b/README.md @@ -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) | |[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) | -|[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) | |[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) | @@ -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) | |[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) | |[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) | |[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) | diff --git a/caesar_cipher/README.md b/caesar_cipher/README.md new file mode 100644 index 0000000..7a2debc --- /dev/null +++ b/caesar_cipher/README.md @@ -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? +``` + diff --git a/caeser_cipher/caeser.py b/caesar_cipher/caesar.py similarity index 90% rename from caeser_cipher/caeser.py rename to caesar_cipher/caesar.py index 8f6a523..40047cf 100755 --- a/caeser_cipher/caeser.py +++ b/caesar_cipher/caesar.py @@ -9,8 +9,8 @@ except AttributeError: maketrans = str.maketrans # python3 -def caeser_cipher(string_: str, offset: int, decode: bool, file_: string) -> None: - """ Caeser Cipher implementation, reads file or string. Also decodes. +def caesar_cipher(string_: str, offset: int, decode: bool, file_: string) -> None: + """ caesar Cipher implementation, reads file or string. Also decodes. Default implementation is ROT13 encoding. @@ -59,7 +59,7 @@ def check_offset_range(value: int) -> int: 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', help='decode ciphertext (offset should equal what was used to encode)', default=False) @@ -72,4 +72,4 @@ if __name__ == '__main__': args = parser.parse_args() - caeser_cipher(args.string, args.offset, args.decode, args.file) + caesar_cipher(args.string, args.offset, args.decode, args.file) diff --git a/caeser_cipher/README.md b/caeser_cipher/README.md deleted file mode 100644 index 86fef4f..0000000 --- a/caeser_cipher/README.md +++ /dev/null @@ -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? -``` -