Struct bc_components::Salt
source · pub struct Salt(/* private fields */);Expand description
Random salt used to decorrelate other information.
Implementations§
source§impl Salt
impl Salt
sourcepub fn new_with_len(count: usize) -> Result<Self>
pub fn new_with_len(count: usize) -> Result<Self>
Create a specific number of bytes of salt.
If the number of bytes is less than 8, this will return None.
sourcepub fn new_with_len_using(
count: usize,
rng: &mut impl RandomNumberGenerator
) -> Result<Self>
pub fn new_with_len_using( count: usize, rng: &mut impl RandomNumberGenerator ) -> Result<Self>
Create a specific number of bytes of salt.
If the number of bytes is less than 8, this will return None.
sourcepub fn new_in_range(range: RangeInclusive<usize>) -> Result<Self>
pub fn new_in_range(range: RangeInclusive<usize>) -> Result<Self>
Create a number of bytes of salt chosen randomly from the given range.
If the minimum number of bytes is less than 8, this will return None.
sourcepub fn new_in_range_using(
range: &RangeInclusive<usize>,
rng: &mut impl RandomNumberGenerator
) -> Result<Self>
pub fn new_in_range_using( range: &RangeInclusive<usize>, rng: &mut impl RandomNumberGenerator ) -> Result<Self>
Create a number of bytes of salt chosen randomly from the given range.
If the minimum number of bytes is less than 8, this will return None.
sourcepub fn new_for_size(size: usize) -> Self
pub fn new_for_size(size: usize) -> Self
Create a number of bytes of salt generally proportionate to the size of the object being salted.
sourcepub fn new_for_size_using(
size: usize,
rng: &mut impl RandomNumberGenerator
) -> Self
pub fn new_for_size_using( size: usize, rng: &mut impl RandomNumberGenerator ) -> Self
Create a number of bytes of salt generally proportionate to the size of the object being salted.
Trait Implementations§
source§impl CBORDecodable for Salt
impl CBORDecodable for Salt
source§impl CBOREncodable for Salt
impl CBOREncodable for Salt
source§impl CBORTagged for Salt
impl CBORTagged for Salt
source§impl CBORTaggedDecodable for Salt
impl CBORTaggedDecodable for Salt
source§fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for Salt
impl CBORTaggedEncodable for Salt
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl PartialEq for Salt
impl PartialEq for Salt
source§impl URDecodable for Salt
impl URDecodable for Salt
source§impl UREncodable for Salt
impl UREncodable for Salt
impl Eq for Salt
impl StructuralPartialEq for Salt
impl URCodable for Salt
Auto Trait Implementations§
impl !Freeze for Salt
impl RefUnwindSafe for Salt
impl Send for Salt
impl Sync for Salt
impl Unpin for Salt
impl UnwindSafe for Salt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)