Code re use by example - sipke/utils GitHub Wiki
Code re-use is far lower than it should be. Here are some useful open source implementations. Use them rather than re-invent the wheel.
freebsd is a good place to search for anything you think may be common in C. https://web.mit.edu/freebsd/head/contrib/wpa/src/utils/common.c e.g. hex string to binary data.