OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::sha1sum_fn Struct Reference

Function object to compute SHA-1 checksums of files and streams. More...

#include <sha1sum.hpp>

Public Member Functions

auto operator() (std::FILE *file, const size_t chunk_size) const
auto operator() (std::filesystem::path const &path, const size_t chunk_size) const

Detailed Description

Function object to compute SHA-1 checksums of files and streams.

Member Function Documentation

◆ operator()() [1/2]

auto oxy::sha1sum_fn::operator() ( std::FILE * file,
const size_t chunk_size ) const
inline
Parameters
fileA pointer to a C-style FILE object representing the input stream.
chunk_sizeThe size of the buffer to use for reading the file in chunks.
Returns
A string representing the SHA-1 checksum of the input stream.

References oxy::hash, and oxy::to_string().

Referenced by operator()().

◆ operator()() [2/2]

auto oxy::sha1sum_fn::operator() ( std::filesystem::path const & path,
const size_t chunk_size ) const
inline
Parameters
pathA filesystem path representing the file to compute the checksum for.
chunk_sizeThe size of the buffer to use for reading the file in chunks.
Returns
A string representing the SHA-1 checksum of the file at the specified path.

References operator()().