blob: 117bc14f3d43e4ccc7051017dac6ebad35c1f5f7 [file] [log] [blame]
Austin Schuhb0e439d2023-05-15 10:55:40 -07001#ifndef AOS_SHA256_H_
2#define AOS_SHA256_H_
3
James Kuszmaul56802ab2023-08-23 15:18:34 -07004#include <filesystem>
Austin Schuhb0e439d2023-05-15 10:55:40 -07005#include <string>
6
7#include "absl/types/span.h"
8
9namespace aos {
10
11// Returns the sha256 of a span.
12std::string Sha256(const absl::Span<const uint8_t> str);
James Kuszmaul56802ab2023-08-23 15:18:34 -070013std::string Sha256(std::string_view str);
14
15// Returns the Sha256 of the specified file. Dies on failure to read the file.
16std::string Sha256OfFile(std::filesystem::path file);
Austin Schuhb0e439d2023-05-15 10:55:40 -070017
18} // namespace aos
19
20#endif // AOS_SHA256_H_