Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
|
Hash utility functions to produce a hash file compatible to sha256sum
as well as to produce the hash value itself for validation.
More...
Functions | |
bool | append_to_file (const std::string &out_file, const std::string &hashed_file, const std::string_view &hash_algo, const std::vector< uint8_t > &hash_value) noexcept |
Append the hash signature to the text file out_file. More... | |
std::unique_ptr< std::vector< uint8_t > > | calc (const std::string_view &algo, const std::string &path_or_uri, uint64_t &bytes_hashed, jau::fraction_i64 timeout=20_s) noexcept |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory. More... | |
std::unique_ptr< std::vector< uint8_t > > | calc (const std::string_view &algo, jau::io::ByteInStream &source) noexcept |
Return the calculated hash value using given algo name and byte input stream. More... | |
std::string | file_suffix (const std::string &algo) noexcept |
Return a lower-case file suffix used to store a sha256sum compatible hash signature w/o dot and w/o dashes. More... | |
Hash utility functions to produce a hash file compatible to sha256sum
as well as to produce the hash value itself for validation.
|
noexcept |
Return a lower-case file suffix used to store a sha256sum
compatible hash signature w/o dot and w/o dashes.
Definition at line 348 of file crypto0.cpp.
|
noexcept |
Append the hash signature to the text file out_file.
The hash signature is composed as follows
*
to denote binary processingThe hash signature is similar to sha256sum
output, but the added hash algo name upfront.
out_file | the text file to append hash signature of hashed_file. |
hashed_file | the file of the hash signature |
hash_algo | the hash algo name used |
hash_value | the hash value of hashed_file |
Definition at line 358 of file crypto0.cpp.
|
noexcept |
Return the calculated hash value using given algo name and byte input stream.
algo | the hash algo name |
source | the byte input stream |
Definition at line 386 of file crypto0.cpp.
|
noexcept |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory.
algo | the hash algo name |
path_or_uri | given path or uri, either a URI denoting a single file, a single file path or directory path for which all files (not symbolic links) are considered |
bytes_hashed | returns overall bytes hashed |
timeout | in case path_or_uri refers to an URI, timeout is being used as maximum duration to wait for next bytes. Defaults to 20_s. |
Definition at line 411 of file crypto0.cpp.