bytes
XuAPI
pub fn bytes(seed int, data &string) intPurpose
Return the buffered bytes.
Parameters
seedint- random seed (int)
data&string- data (borrowed; caller keeps it; type &string)
Returns
int — a value of this type
API
#hash/maphashPortable byte hash with explicit seed (not hardware AES bits).
bytespub fn bytes(seed int, data &string) intReturn the buffered bytes.
seed intdata &stringint — a value of this type
of_stringpub fn of_string(seed int, s &string) intOf string.
seed ints &stringint — a value of this type
struct Hashpub struct Hash {
pub seed int
pub state int
pub n int
}Public struct `Hash`.
seed intstate intn intnewpub fn new(seed int) HashConstruct a new value of this type.
seed intHash — a value of this type
(&mut Hash) set_seedpub fn (h &mut Hash) set_seed(seed int)Method on `&mut Hash`: set seed.
h &mut Hashseed int(&mut Hash) resetpub fn (h &mut Hash) reset()Method on `&mut Hash`: clear internal state so the value can be reused.
h &mut Hash(&mut Hash) writepub fn (h &mut Hash) write(p &string) intMethod on `&mut Hash`: write data and return the byte count.
h &mut Hashp &stringint — bytes written
(Hash) sum64pub fn (h Hash) sum64() intMethod on `Hash`: compute a digest (often lowercase hex).
h Hashint — a value of this type
(Hash) seedpub fn (h Hash) seed() intCall `seed` on `Hash`.
h Hashint — a value of this type