b7fb0630f2c466412337d25d2e611eeef7bc381b,ciphers/caesar_cipher.py,,encrypt,#Any#Any#,1

Before Change


    encrypted = ""
    for x in strng:
        indx = (ord(x) + key) % 256
        if indx > 126:
            indx = indx - 95
        encrypted = encrypted + chr(indx)
    return encrypted

After Change

def encrypt(input_string: str, key: int) -> str:
    result = ""
    for x in input_string:
        if not x.isalpha():
            result += x
        elif x.isupper():
            result += chr((ord(x) + key - 65) % 26 + 65)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: TheAlgorithms/Python
Commit Name: b7fb0630f2c466412337d25d2e611eeef7bc381b
Time: 2019-10-17
Author: 33547678+yuriimchg@users.noreply.github.com
File Name: ciphers/caesar_cipher.py
Class Name:
Method Name: encrypt


Project Name: prody/ProDy
Commit Name: 145bfbb31d1a2b11dc241b2567476cd64966b14b
Time: 2012-11-05
Author: lordnapi@gmail.com
File Name: lib/prody/proteins/blastpdb.py
Class Name:
Method Name: blastPDB


Project Name: TheAlgorithms/Python
Commit Name: b7fb0630f2c466412337d25d2e611eeef7bc381b
Time: 2019-10-17
Author: 33547678+yuriimchg@users.noreply.github.com
File Name: ciphers/caesar_cipher.py
Class Name:
Method Name: decrypt