C Utility Library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.0 KiB


libutil is a lightweight library to be included locally in projects that is intended to provide common portable extensions to the C standard library.


Component Description Standard
alloc Memory allocation wrapper functions
base32 Encode or decode Base32
base64 Encode or decode Base64
crypt General cryptography functions
endian Endianness related functions
error Error reporting functions
fnv FNV hashing algorithms
map Generic hashmap data structure
mode Parse numeric or symbolic POSIX modes
optget Parse command line options
rc2 RC2 encryption algorithm RFC 2268
strconv String conversion functions
util Base typedefs and macros

Note that util.h is required by many other libutil components.


libutil is being developed on x86-64 Linux, is untested elsewhere, and some components may depend on POSIX provided functionality.

libutil source files are intended to be built directly into projects, rather than being compiled seperately and linked.


  • CMake >= 3.12, to build


To build libutil and its unit tests on UNIX, run BuildUNIX.sh.

  • Binaries will be located in the bin directory.
  • Libraries will be located in the lib directory.


To run libutil unit tests on UNIX, run TestUNIX.sh once built.


Copyright (C) 2020, Jakob Wakeling
MIT Licence