本文整理汇总了Python中cipher.Cipher.encode方法的典型用法代码示例。如果您正苦于以下问题:Python Cipher.encode方法的具体用法?Python Cipher.encode怎么用?Python Cipher.encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cipher.Cipher
的用法示例。
在下文中一共展示了Cipher.encode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cipher_compositiion2
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_compositiion2(self):
plaintext = 'adaywithoutlaughterisadaywasted'
c = Cipher()
self.assertEqual(plaintext, c.decode(c.encode(plaintext)))
示例2: test_cipher_compositiion1
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_compositiion1(self):
key = ('duxrceqyaimciuucnelkeoxjhdyduucpmrxmaivacmybmsdrzwqxvbxsy'
'gzsabdjmdjabeorttiwinfrpmpogvabiofqexnohrqu')
plaintext = 'adaywithoutlaughterisadaywasted'
c = Cipher(key)
self.assertEqual(plaintext, c.decode(c.encode(plaintext)))
示例3: test_cipher_encode_short_key
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_encode_short_key(self):
c = Cipher('abcd')
self.assertEqual('abcdabcd', c.encode('aaaaaaaa'))
示例4: test_cipher_encode4
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_encode4(self):
key = ('duxrceqyaimciuucnelkeoxjhdyduucpmrxmaivacmybmsdrzwqxvbxsy'
'gzsabdjmdjabeorttiwinfrpmpogvabiofqexnohrqu')
c = Cipher(key)
self.assertEqual('gccwkixcltycv', c.encode('diffiehellman'))
示例5: test_cipher_encode3
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_encode3(self):
c = Cipher('dddddddddddddddddddddd')
self.assertEqual('yhqlylglylfl', c.encode('venividivici'))
示例6: test_cipher_encode2
# 需要导入模块: from cipher import Cipher [as 别名]
# 或者: from cipher.Cipher import encode [as 别名]
def test_cipher_encode2(self):
c = Cipher('aaaaaaaaaaaaaaaaaaaaaa')
self.assertEqual('itisawesomeprogramminginpython',
c.encode('itisawesomeprogramminginpython'))