[−][src]Struct hashcash::Stamp
Methods
impl Stamp
[src]
pub fn mint(
resource: Option<&str>,
bits: Option<u32>,
now: Option<DateTime<Utc>>,
ext: Option<&str>,
saltchars: Option<usize>,
stamp_seconds: bool
) -> Result<Self>
[src]
resource: Option<&str>,
bits: Option<u32>,
now: Option<DateTime<Utc>>,
ext: Option<&str>,
saltchars: Option<usize>,
stamp_seconds: bool
) -> Result<Self>
Mint a new hashcash stamp for 'resource' with 'bits' of collision 20 bits of collision is the default.
'ext' lets you add your own extensions to a minted stamp. Specify an extension as a string of form 'name1=2,3;name2;name3=var1=2,2,val'
'saltchars' specifies the length of the salt used; this version defaults 8 chars, rather than the C version's 16 chars. This still provides about 17 million salts per resource, per timestamp, before birthday paradox collisions occur. Really paranoid users can use a larger salt though.
'stamp_seconds' lets you add the option time elements to the datestamp. If you want more than just day, you get all the way down to seconds, even though the spec also allows hours/minutes without seconds.
pub fn with_secs() -> Result<Self>
[src]
pub fn with_resource(resource: &str, stamp_seconds: bool) -> Result<Self>
[src]
pub fn with_bits(bits: u32, stamp_seconds: bool) -> Result<Self>
[src]
pub fn with_resource_and_bits(
resource: &str,
bits: u32,
stamp_seconds: bool
) -> Result<Self>
[src]
resource: &str,
bits: u32,
stamp_seconds: bool
) -> Result<Self>
Trait Implementations
impl Debug for Stamp
[src]
impl Default for Stamp
[src]
impl Display for Stamp
[src]
impl<'_> TryFrom<&'_ str> for Stamp
[src]
Auto Trait Implementations
impl RefUnwindSafe for Stamp
impl Send for Stamp
impl Sync for Stamp
impl Unpin for Stamp
impl UnwindSafe for Stamp
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,