#lua #mlua #crc16 #api-bindings #rust-native #luacrc16 #preload

mlua-crc16

A Rust-native implementation of luarocks.org/modules/youlu/luacrc16 for mlua

2 stable releases

1.0.1 Feb 3, 2024
1.0.0 Oct 7, 2023

#1 in #mlua

Download history 38/week @ 2024-01-15 138/week @ 2024-01-29 93/week @ 2024-02-12 21/week @ 2024-02-19 47/week @ 2024-02-26 24/week @ 2024-03-11 56/week @ 2024-03-18 34/week @ 2024-03-25 94/week @ 2024-04-01

208 downloads per month

MIT license

5KB

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

Dependencies

~1.6–3.5MB
~52K SLoC