Skip to main content

Module avatar

Module avatar 

Source
Expand description

The sender’s avatar for the new device’s screen: a small thumbnail that rides in the sealed hello, so the new device fetches nothing before sign-in. The receiver re-encodes whatever arrives, so the page only ever renders a PNG this code produced.

Constants§

MAX_BYTES
The largest thumbnail a sender includes or a receiver accepts.

Functions§

sanitize
A PNG data URL re-encoded from untrusted thumbnail bytes: raster formats only, small dimensions only, never handed to the page as received.
thumbnail
A small square JPEG of the cached avatar bytes, or None if it won’t decode or shrink enough.