Converting int to bytes in Python 3 - Stack Overflow

The ASCIIfication of 3 is "\x33" not "\x03"!. That is what python does for str(3) but it would be totally wrong for bytes, as they should be considered arrays of binary data and not be abused as strings.. The most easy way to achieve what you want is bytes((3,)), which is better than bytes([3]) because initializing a list is much more expensive, so never use lists when you can use tuples.

ffi* API Functions - LuaJIT

This page describes the API functions provided by the FFI library in detail. It's recommended to read through the introduction and the FFI tutorial first. Glossary. cdecl — An abstract C type declaration (a Lua string).; ctype — A C type object. This is a special kind of cdata returned by ffi.typeof().It serves as a cdata constructor when called. cdata — A C data object.