]> git.zerfleddert.de Git - proxmark3-svn/blame - client/README-bitlib
CHG: `lf em` - some minor refactoring in 4x50 commands
[proxmark3-svn] / client / README-bitlib
CommitLineData
77cd612f 1 bitlib
2 ------
3
4 by Reuben Thomas <rrt@sc3d.org>
5 http://luaforge.net/projects/bitlib
6
7
8bitlib is a C library for Lua 5.1 that provides bitwise operations. It
9is copyright Reuben Thomas 2000-2009, and is released under the MIT
10license, like Lua (see http://www.lua.org/copyright.html; it's
11basically the same as the BSD license). There is no warranty.
12
13Please report bugs and make suggestions to the email address above, or
14use the LuaForge trackers.
15
16Thanks to John Passaniti for his bitwise operations library, some of
17whose ideas I used, to Shmuel Zeigerman for the test suite, to
18Thatcher Ulrich for portability fixes, and to Enrico Tassi, John
19Stiles and Eduardo Ochs for bug reports.
20
21
22Installation
23------------
24
25As normal:
26
27 ./configure && make [&& make check] [&& make install]
28
29If you get warnings about integer constants being too large, don't
30worry. They won't be used.
31
32The following options may be of interest if you have Lua installed on
33non-default paths (as you are likely to on any system supporting more
34than one version of Lua):
35
36 --libdir=DIR Install shared library in this directory
37 --with-lua-prefix=DIR Lua files are in DIR
38 --with-lua-includes=DIR Lua include files are in DIR
39 --with-lua-libraries=DIR
40 Lua library files are in DIR, or "no" if not used
41 --with-lua-suffix=ARG Lua binary and library files are suffixed with ARG
42
43For example, on Debian or Ubuntu:
44
45 ./configure --libdir=/usr/local/lib/lua/5.1 --with-lua-includes=/usr/include/lua5.1 --with-lua-suffix=5.1 --with-lua-libraries=no
46
47
48Use
49---
50
51Make sure the library is installed on your LUA_CPATH, and require it.
52
53The library provides the constant bit.bits that gives the number of
54bits that can be used in bitwise operations, and the following
55functions:
56
57bit.cast(a) cast a to the internally-used integer type
58bit.bnot(a) returns the one's complement of a
59bit.band(w1, ...) returns the bitwise and of the w's
60bit.bor(w1, ...) returns the bitwise or of the w's
61bit.bxor(w1, ...) returns the bitwise exclusive or of the w's
62bit.lshift(a, b) returns a shifted left b places
63bit.rshift(a, b) returns a shifted logically right b places
64bit.arshift(a, b) returns a shifted arithmetically right b places
65
66All function arguments should be integers that fit into the C type
67lua_Integer.
68
69The logical operations start with "b" for "bit" to avoid clashing with
70reserved words; although "xor" isn't a reserved word, it seemed better
71to use "bxor" for consistency.
Impressum, Datenschutz