bytes
XuAPI
pub fn bytes(seed int, data &string) int用途
返回已缓冲的字节串。
参数
seedint- 随机种子(int)
data&string- 数据(借用,调用方仍持有;类型 &string)
返回
int — 该类型的值
API
#hash/maphash显式 seed 的可移植字节哈希(非硬件 AES 位型)。
bytespub fn bytes(seed int, data &string) int返回已缓冲的字节串。
seed intdata &stringint — 该类型的值
of_stringpub fn of_string(seed int, s &string) intof字符串。
seed ints &stringint — 该类型的值
struct Hashpub struct Hash {
pub seed int
pub state int
pub n int
}公开结构体 `Hash`。
seed intstate intn intnewpub fn new(seed int) Hash构造该类型的新值。
seed intHash — 该类型的值
(&mut Hash) set_seedpub fn (h &mut Hash) set_seed(seed int)`&mut Hash` 上的方法:设置 seed。
h &mut Hashseed int(&mut Hash) resetpub fn (h &mut Hash) reset()`&mut Hash` 上的方法:清空内部状态,可再写入或读取。
h &mut Hash(&mut Hash) writepub fn (h &mut Hash) write(p &string) int`&mut Hash` 上的方法:写入数据,返回写入的字节数。
h &mut Hashp &stringint — 写入的字节数
(Hash) sum64pub fn (h Hash) sum64() int`Hash` 上的方法:计算摘要(多为小写 hex)。
h Hashint — 该类型的值
(Hash) seedpub fn (h Hash) seed() int`Hash` 上的方法:种子。
h Hashint — 该类型的值