Cesar密码

cesar-cipher的Python项目详细描述


塞萨尔密码

安装

$ pip install cesar_cipher

用法

fromcesar_cipherimportcscs.cesar(msg,cmd,key=3)# where:#   * 'msg' is the message/char to be encrypt/decrypt#   (special digits are ignored)#   * 'cmd' is the command to define the operation#   ('e' to encrypt and 'd' to decrypt)#   * 'key' is optional (default 3) key to encrypt/decrypt

示例

>>>from cesar_cipher import cs
>>># Encrypting the letter 'a' with default key (3)
>>>print(cs.cesar('a', 'e'))'d'
>>># Decrypting the letter 'd' with default key (3)
>>>print(cs.cesar('d', 'd'))'a'
>>># Encrypting the string 'abc' with default key (3)
>>>print(cs.cesar('ABC', 'e'))'DEF'

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
字符串Java字母替换无效   java Spring Roo JPA MS SQL Server无法打开JPA EntityManager组织。冬眠例外GenericJDBCException:无法打开连接   在scala中使用JavaWS对大型数据文件进行java流式处理   Java编译器是否将字节和短字符识别为文本?   java无法查找符号错误,空指针   mongodb在Java中重用数据库连接   java将多个StringArray从字符串文件获取到活动中   java是一个变量,它只保存最后一次鼠标单击的坐标   c#尺寸有限;添加、删除和洗牌   java如何在Android中显示来自资产文件夹的文本文件中的文本   Android应用程序中的java Tensorflow Lite自定义对象检测模型错误   java如何在foreachloop中使用scanner将来自命令行的输入存储到数组中   java如何定义一个好的存储库接口   Android中的java解析动态json对象