const block_size
XuAPI
pub const block_size = 8用途
公开常量 `block_size`。 值为 `8`
参数
无
API
#crypto/desDES / 3DES-EDE 单块。
const block_sizepub const block_size = 8公开常量 `block_size`。 值为 `8`
无
struct Cipherpub struct Cipher {
pub subkeys []int
}公开结构体 `Cipher`。
subkeys []intstruct TripleCipherpub struct TripleCipher {
pub k1 []int
pub k2 []int
pub k3 []int
}公开结构体 `TripleCipher`。
k1 []intk2 []intk3 []intnew_cipherpub fn new_cipher(key &string) Cipher构造 cipher。失败时 throw。
key &stringCipher — 该类型的值
(&Cipher) block_sizepub fn (c &Cipher) block_size() int`&Cipher` 上的方法:块尺寸。
c &Cipherint — 该类型的值
(&Cipher) encryptpub fn (c &Cipher) encrypt(src &string) string`&Cipher` 上的方法:加密。
c &Ciphersrc &stringstring — 结果字符串
(&Cipher) decryptpub fn (c &Cipher) decrypt(src &string) string`&Cipher` 上的方法:解密。
c &Ciphersrc &stringstring — 结果字符串
new_triple_cipherpub fn new_triple_cipher(key &string) TripleCipher构造 triple cipher。失败时 throw。
key &stringTripleCipher — 该类型的值
(&TripleCipher) encryptpub fn (c &TripleCipher) encrypt(src &string) string`&TripleCipher` 上的方法:加密。
c &TripleCiphersrc &stringstring — 结果字符串
(&TripleCipher) decryptpub fn (c &TripleCipher) decrypt(src &string) string`&TripleCipher` 上的方法:解密。
c &TripleCiphersrc &stringstring — 结果字符串