本文整理匯總了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'))