This C code demonstrates how to integrate the Python-based hash calculator module into a C program. The provided Makefile simplifies the build process.
The C code includes a function named sha_256
that interfaces with the Python script. This function allows you to compute SHA-256 or SHA3-256 hashes for a given input string.
Ensure that you have Python 3.x installed on your system. The Makefile assumes Python 3.11; adjust the flags accordingly for a different Python version.
-
Build the executable using the provided Makefile:
make
-
Run the compiled C executable:
./build/application