CMake
provides you with two hashing functions: string(<hash-algorithm>)
and file(<hash-algorithm>)
. These work just fine but I reformed them to work well with cmakepp
and extended the functionality:
- checksum_dir
- checksum_file
- checksum_files
- checksum_glob_ignore
- checksum_layout
- checksum_object
- checksum_string
- content_dir_check
- content_dir_update
(<direcotry> [--algorthm <checksum algorithm> = "MD5"])-><checksum>
calculates the checksum for the specified directory just like checksum_layout however also factors in the file's contents
(<file> [--algorithm <checksum algorithm> = "MD5"])-><checksum>
calculates the checksum for the specified file delegates the
call to CMake
's file() function
(<base dir> <file...>)-><checksum>
create a checksum from specified files relative to
the checksum is influenced by the files relative paths and the file content(<glob ignore expressions...> [--algorithm <hash algorithm> = "MD5"])-><checksum>
calculates the checksum for the specified glob ignore expressIONS uses checksum_files internally. the checksum is unique to file content and relative file structure
(<directory> [--algorithm <hash algorithm> "MD5"])-><checksum>
this method generates the checksum for the specified directory it is done by taking every file's relative path into consideration and generating the hash. The file's content does not influence the hash
(<any> [--algorithm <hash algorithm> = "MD5"])-><checksum>
this function takes any value and generates its hash the difference to string hash is that it serializes the specified object which lets you create the hash for the whoile object graph.
(<string> [--algorithm <hash algorithm> = MD5])-><checksum>
<hash algorithm> ::= "MD5"|"SHA1"|"SHA224"|"SHA256"|"SHA384"|"SHA512"
this function takes any string and computes the hash value of it using the hash algorithm specified (which defaults to MD5) returns the checksum