react-native-matrix-crypto
    Preparing search index...

    Interface ScannableCode

    A code for a person to hold up to another camera, in both of the forms a product needs to draw one.

    Two forms and not one, and the second is not a convenience. payload is binary and is not text: it carries two raw signing keys and a random shared secret, and there is no string it can honestly be turned into. A product handed only bytes reaches for a JavaScript component that draws a code from a string, and draws a square that decodes to something else. modules is the symbol these bytes were encoded into on the way out, at the version and error-correction level the protocol's own encoder fixes because mobile clients have trouble decoding otherwise, so a product that draws the grid draws what the protocol meant rather than a re-encoding of it.

    Drawing it. modules is row-major and has exactly width * width entries; true is a dark square. A product draws width rows of width squares, leaves the usual quiet margin around them, and shows it. There is no image here and there never will be: this library draws nothing, and has no business choosing a size, a colour or a margin for somebody else's screen.

    Treat this value as secret while the flow is open, exactly as SasMaterial is treated. The payload carries the shared secret the whole method rests on, and the grid is that same secret drawn as squares. Anything that learns either learns what an interposed party would need to answer the flow as though it had read the screen. Do not log it, do not persist it, do not put it in a crash report. The Rust core redacts its own copy and cannot reach across this boundary to do the same here.

    interface ScannableCode {
        modules: boolean[];
        payload: Uint8Array;
        width: number;
    }
    Index
    modules: boolean[]

    The symbol, row-major, width * width entries. true is dark.

    payload: Uint8Array

    The bytes the protocol defines. About 126 of them, binary.

    width: number

    The side length, in squares, of the symbol below.