allenli178/moon-qrcode/core does not have a README file
test "encode hello world" {
let qr = @core.encode("HELLO WORLD") // V1-M
assert_eq(qr.size(), 21)
assert_eq(qr.version().value(), 1)
}test "encode raw bytes" {
let qr = @core.encode_bytes(b"\xff\x00\x80")
assert_eq(qr.version().value(), 1)
}test "encode custom segments" {
let segments = [
@core.Segment::new(@core.Mode::Numeric, "123"),
@core.Segment::new(@core.Mode::Byte, "abc"),
]
let qr = @core.encode_segments(segments)
assert_eq(qr.version().value(), 1)
}fn total_codewords(version : Int) -> Intfn version_info(version : Int) -> Int?Install
Download zipPure-MoonBit QR Code Model 2 encoder with optimal segmentation, ASCII/SVG renderers, payload templates, a native CLI and a typed JS/npm API | 纯 MoonBit 实现的 QR Code Model 2 编码器,支持最优分段、ASCII/SVG 渲染、载荷模板、原生 CLI 和带类型的 JS/npm API