mlua-crc16

Crates.iomlua-crc16
lib.rsmlua-crc16
version1.0.3
sourcesrc
created_at2023-10-07 13:36:53.682247
updated_at2024-10-29 13:17:13.488137
descriptionA Rust-native implementation of luarocks.org/modules/youlu/luacrc16 for mlua
homepagehttps://on-prem.net
repositoryhttps://gitlab.com/megalithic-llc/mlua-crc16.git
max_upload_size
id996322
size7,676
David Rauschenbach (drauschenbach)

documentation

README

mlua-crc16

A Rust-native implementation of luacrc16 for mlua.

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-crc16 --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_crc16::preload(&lua)?;
let script = r#"
    local crc16 = require('crc16')
    return crc16.compute('abc 123')
"#
let crc16: u16 = lua.load(script).eval()?;
assert_eq!(crc16, 0x8831_u16);

Testing

$ make check
Commit count: 19

cargo fmt