def create_mapping_from_cipher(cipher):
"""
Creates the mapping between the alphabet string and the cipher string
Inputs
------
cipher : a string, in which order matters, that is mapped to from the alphabet in the
encrypted document i.e. abcdefg.. -> udhjenk...
Returns
-------
a dictionary in which each key is a letter of the alphabet, and each value is
the corresponding letter in the cipher
"""
charset = list(string.lowercase)
return {charset.pop(0):elem for elem in cipher}
mcmc.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录