[][src]Struct hashcash::Stamp

pub struct Stamp { /* fields omitted */ }

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]

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]

Trait Implementations

impl Debug for Stamp[src]

impl Default for Stamp[src]

impl Display for Stamp[src]

impl<'_> TryFrom<&'_ str> for Stamp[src]

type Error = HcError

The type returned in the event of a conversion error.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,