欧美人与性动交α欧美精品,边摸边吃奶做爽A片视频,亚洲精品动漫免费二区,刺激一区仑乱

Section Menu:  

字符串加密解密函數(shù):cipher()

  • 發(fā)布時間: 2020-01-17 09:32
  •    閱讀: 3258   

描述

cipher() 對字符串加密解密
cipher() 接收四個參數(shù),第一個參數(shù)為原文或者密文,第二個參數(shù)為動作1加密、0解密,第三個參數(shù)為密文有效期,加密時有效單位秒,0為永久有效,  第四個參數(shù)為密鑰,用于加密解密的密鑰,默認(rèn)使用 "config/key.ini" 配置參數(shù)


語法

以下是 cipher() 的語法:

cipher(string, operation=0, expiry=0, key=None)

參數(shù)

       ●  string [str]:原文或者密文。
       ●  operation [int]:動作,1加密、0解密。
       ●  expiry [int]:密文有效期, 加密時候有效, 單位 秒,0 為永久有效。
       ●  key [str]:密鑰,用于加密解密的密鑰,默認(rèn)使用 "config/key.ini" 配置參數(shù)。


返回值

返回一個str類型的數(shù)據(jù)


實例

以下展示了使用 cipher() 的實例:

from kyger.utility import cipher
data = cipher('/upload/download/file/201912/20191227134915556.rar', 1)  # 加密
print(data)
res = cipher(data, 0)  # 解密
print(res)

以上實例運(yùn)行后輸出的結(jié)果為:

'2b9ea388cd49fd874ba5002e16afae93w6ERdELDrndew67DmiwTwrECUU81L8OHBsOuccKdRsOqwpjCgcOFHDoDSn3DlcOoRSQwEF1ow4XDmMOaPX3CiMOvbcK4VF47SMKNwqvCohNswq9lCl5JwrtCwobDocOyw6vCrhwCGsKsw7ZP'
'/upload/download/file/201912/20191227134915556.rar'

適應(yīng)版本

   v1.0.1