pub struct InputIdentity { /* private fields */ }Expand description
Immutable identity of the bytes used to produce one file report.
The digest is lowercase hexadecimal SHA-256 so consumers can compare identities without retaining the source bytes themselves.
Implementations§
Source§impl InputIdentity
impl InputIdentity
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Calculate the identity for source bytes.
Sourcepub fn from_sha256_digest(digest: [u8; 32], bytes: u64) -> Self
pub fn from_sha256_digest(digest: [u8; 32], bytes: u64) -> Self
Construct an identity from an already-computed SHA-256 digest and exact byte count.
This keeps streaming and bounded readers on the same lowercase digest authority without exposing an unchecked string constructor.
Sourcepub fn from_sha256_hex(sha256: &str, bytes: u64) -> Option<Self>
pub fn from_sha256_hex(sha256: &str, bytes: u64) -> Option<Self>
Construct an identity from an already-formatted lowercase hexadecimal SHA-256 digest and exact byte count.
Returns None unless sha256 is exactly 64 lowercase hexadecimal
digits. Uppercase is refused rather than normalized, so every stored
digest keeps the one lowercase authority sha256_hex establishes and
the wire deserializers already require.
Trait Implementations§
Source§impl Clone for InputIdentity
impl Clone for InputIdentity
Source§fn clone(&self) -> InputIdentity
fn clone(&self) -> InputIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more