XU XUv0.8.8
EN

API

#crypto/rc4

import: #crypto/rc4

counts: 1 函数, 1 方法, 1 类型, 0 常量, 0 方法集

RC4 流密码。算法已破,仅协议互通。

struct Cipher

XuAPI
pub struct Cipher {
    pub s []int
    pub i int
    pub j int
}

用途

公开结构体 `Cipher`。

参数

s []int
源字符串
i int
下标或整数
j int
下标

new_cipher

XuAPI
pub fn new_cipher(key &string) Cipher

用途

构造 cipher。失败时 throw。

参数

key &string
键(借用,调用方仍持有;类型 &string)

返回

Cipher — 该类型的值

(&mut Cipher) xor_key_stream

XuAPI
pub fn (c &mut Cipher) xor_key_stream(src &string) string

用途

`&mut Cipher` 上的方法:xor键流。

参数

c &mut Cipher
接收者 &mut Cipher(可变借用)
src &string
源数据(借用,调用方仍持有;类型 &string)

返回

string — 结果字符串