#matrix-chat #ruma #messaging #nio #chat

matrix-sdk-qrcode

Library to encode and decode QR codes for interactive verifications in Matrix land

8 releases (breaking)

new 0.11.0 Apr 11, 2025
0.10.0 Feb 4, 2025
0.9.0 Dec 18, 2024
0.8.0 Nov 19, 2024
0.3.0 May 11, 2022

#1179 in Cryptography

Download history 190/week @ 2024-12-21 121/week @ 2024-12-28 72/week @ 2025-01-04 3/week @ 2025-01-11 263/week @ 2025-02-01 239/week @ 2025-02-08 68/week @ 2025-02-15 31/week @ 2025-02-22 22/week @ 2025-03-01 31/week @ 2025-03-08 70/week @ 2025-03-15 10/week @ 2025-03-22 38/week @ 2025-03-29 157/week @ 2025-04-05

280 downloads per month
Used in 4 crates (2 directly)

Apache-2.0

36KB
378 lines

matrix-sdk-qrcode is a crate to easily generate and parse QR codes for interactive verification using QR codes in Matrix.

Usage

This is probably not the crate you are looking for, it's used internally in the matrix-sdk.

If you still want to play with QR codes, here is a helpful example.

Encode into a QR code

use matrix_sdk_qrcode::{QrVerificationData, DecodingError};
use image::Luma;

fn main() -> Result<(), DecodingError> {
    let data = b"MATRIX\
        \x02\x02\x00\x07\
        FLOW_ID\
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
        BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\
        SHARED_SECRET";

    let data = QrVerificationData::from_bytes(data)?;
    let encoded = data.to_qr_code().unwrap();
    let image = encoded.render::<Luma<u8>>().build();

    Ok(())
}

Dependencies

~20MB
~343K SLoC