pub struct Stamp { /* private fields */ }Implementations§
Source§impl Stamp
impl Stamp
Sourcepub fn mint_wasm(
resource: Option<&str>,
bits: Option<u32>,
now: Option<u32>,
ext: Option<&str>,
saltchars: Option<usize>,
stamp_seconds: bool,
) -> Result<Self>
pub fn mint_wasm( resource: Option<&str>, bits: Option<u32>, now: Option<u32>, ext: Option<&str>, saltchars: Option<usize>, stamp_seconds: bool, ) -> Result<Self>
Like mint() but for webassembly, 32bit system safe
Sourcepub fn mint(
resource: Option<&str>,
bits: Option<u32>,
now: Option<i64>,
ext: Option<&str>,
saltchars: Option<usize>,
stamp_seconds: bool,
) -> Result<Self>
pub fn mint( resource: Option<&str>, bits: Option<u32>, now: Option<i64>, 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.