Austin Schuh | b0e439d | 2023-05-15 10:55:40 -0700 | [diff] [blame] | 1 | #ifndef AOS_SHA256_H_ |
| 2 | #define AOS_SHA256_H_ |
| 3 | |
James Kuszmaul | 56802ab | 2023-08-23 15:18:34 -0700 | [diff] [blame] | 4 | #include <filesystem> |
Austin Schuh | b0e439d | 2023-05-15 10:55:40 -0700 | [diff] [blame] | 5 | #include <string> |
| 6 | |
| 7 | #include "absl/types/span.h" |
| 8 | |
| 9 | namespace aos { |
| 10 | |
| 11 | // Returns the sha256 of a span. |
| 12 | std::string Sha256(const absl::Span<const uint8_t> str); |
James Kuszmaul | 56802ab | 2023-08-23 15:18:34 -0700 | [diff] [blame] | 13 | std::string Sha256(std::string_view str); |
| 14 | |
| 15 | // Returns the Sha256 of the specified file. Dies on failure to read the file. |
| 16 | std::string Sha256OfFile(std::filesystem::path file); |
Austin Schuh | b0e439d | 2023-05-15 10:55:40 -0700 | [diff] [blame] | 17 | |
| 18 | } // namespace aos |
| 19 | |
| 20 | #endif // AOS_SHA256_H_ |