Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
hashing.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Luanti Contributors
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#pragma once
6
7#include <string>
8#include <string_view>
9
10namespace hashing
11{
12
13// Size of raw digest in bytes
14constexpr size_t SHA1_DIGEST_SIZE = 20;
15constexpr size_t SHA256_DIGEST_SIZE = 32;
16
17// Returns the digest of data
18std::string sha1(std::string_view data);
19std::string sha256(std::string_view data);
20
21}
Definition hashing.cpp:18
std::string sha256(std::string_view data)
Definition hashing.cpp:35
std::string sha1(std::string_view data)
Definition hashing.cpp:20
constexpr size_t SHA1_DIGEST_SIZE
Definition hashing.h:14
constexpr size_t SHA256_DIGEST_SIZE
Definition hashing.h:15