Skip to main content

Module content

Module content 

Source
Expand description

Record content, canonical hashing and picture headers. Use the store borrowed through SurfaceCx::content or LaunchInput::content so the host binds reads and writes to the resource’s content lane.

Structs§

ContentStore
An app’s handle to binary content: cheap to clone, passed to whatever needs it.
ImageFormat
A picture format, named by its file extension and media type.

Functions§

hash_bytes
Hash bytes the way every content address in the system is derived: BLAKE3, lower-case hex.
image_format
The picture format bytes start with, from the signature alone: PNG, JPEG, GIF, WebP or SVG. Unlike [sniff] it needs no complete header, so it also answers for a truncated prefix.
image_size
A PNG, JPEG, GIF or WebP picture’s format and intrinsic width and height, read from its header. None when bytes is no such picture or its header states no size.
valid_hash
Whether hash has the shape of a content address (64 lower- or upper-case hex digits). Addresses arrive from documents and peers, so anything else is refused before it can name a path.