#lua #mlua #crc16 #api-bindings #preload #luacrc16 #luarocks

mlua-crc16

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

4 stable releases

1.0.3 Oct 29, 2024
1.0.2 Oct 19, 2024
1.0.1 Feb 3, 2024
1.0.0 Oct 7, 2023

#1281 in Development tools

Download history 31/week @ 2024-07-29 119/week @ 2024-08-05 198/week @ 2024-08-12 160/week @ 2024-08-19 198/week @ 2024-08-26 111/week @ 2024-09-02 78/week @ 2024-09-09 15/week @ 2024-09-16 15/week @ 2024-09-23 16/week @ 2024-09-30 404/week @ 2024-10-07 148/week @ 2024-10-14 107/week @ 2024-10-21 133/week @ 2024-10-28 10/week @ 2024-11-04 13/week @ 2024-11-11

299 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

~2–8MB
~65K SLoC