NoSpam
used in ToxId
.
Number is used to make sure that there is no friend requests from peers
that know out long term PK, but don't actually know Tox ID.
The preferred way of creating NoSpam
is to generate a random one.
Additionally, it should be possible to set a custom NoSpam
.
https://zetok.github.io/tox-spec/#tox-id
Create new NoSpam
with random bytes.
Two new()
NoSpam
s will always be different:
use self::tox::toxcore::toxid::NoSpam;
assert!(NoSpam::new() != NoSpam::new());
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Always returns a random NoSpam
. Equivalent to the NoSpam::new()
(#method.new).
Returns the "default value" for a type. Read more
The default formatting of NoSpam
.
E.g.:
use self::tox::toxcore::toxid::NoSpam;
assert_eq!(format!("{:X}", NoSpam([0, 0, 0, 0])), "00000000");
assert_eq!(format!("{:X}", NoSpam([255, 255, 255, 255])), "FFFFFFFF");
Formats the value using the given formatter.
Display
should always be the same as UpperHex
.
use self::tox::toxcore::toxid::NoSpam;
let nospam = NoSpam::new();
assert_eq!(format!("{}", nospam), format!("{:X}", nospam));
Formats the value using the given formatter. Read more
Deserialize struct using nom
from raw bytes
Serialize struct into raw bytes using cookie_factory