WPILibC++
2025.0.0-alpha-1-14-g3b6f38d
sha1.h
Go to the documentation of this file.
1
/*
2
sha1.hpp - header of
3
4
============
5
SHA-1 in C++
6
============
7
8
100% Public Domain.
9
10
Original C Code
11
-- Steve Reid <steve@edmweb.com>
12
Small changes to fit into bglibs
13
-- Bruce Guenter <bruce@untroubled.org>
14
Translation to simpler C++ Code
15
-- Volker Grabsch <vog@notjusthosting.com>
16
Safety fixes
17
-- Eugene Hopkinson <slowriot at voxelstorm dot com>
18
*/
19
20
#ifndef WPIUTIL_WPI_SHA1_H_
21
#define WPIUTIL_WPI_SHA1_H_
22
23
#include <stdint.h>
24
25
#include <string>
26
#include <string_view>
27
28
namespace
wpi
{
29
template
<
typename
T>
30
class
SmallVectorImpl;
31
class
raw_istream;
32
33
class
SHA1
{
34
public
:
35
SHA1
();
36
void
Update
(
std::string_view
s);
37
void
Update
(
raw_istream
& is);
38
std::string
Final
();
39
std::string_view
Final
(
SmallVectorImpl<char>
& buf);
40
std::string_view
RawFinal
(
SmallVectorImpl<char>
& buf);
41
static
std::string
FromFile
(
std::string_view
filename);
42
43
private
:
44
uint32_t digest[5];
45
unsigned
char
buffer[64];
46
size_t
buf_size;
47
uint64_t transforms;
48
};
49
50
}
// namespace wpi
51
52
#endif
// WPIUTIL_WPI_SHA1_H_
wpi::SHA1
Definition:
sha1.h:33
wpi::SHA1::RawFinal
std::string_view RawFinal(SmallVectorImpl< char > &buf)
wpi::SHA1::SHA1
SHA1()
wpi::SHA1::FromFile
static std::string FromFile(std::string_view filename)
wpi::SHA1::Update
void Update(std::string_view s)
wpi::SHA1::Final
std::string Final()
wpi::SHA1::Update
void Update(raw_istream &is)
wpi::SHA1::Final
std::string_view Final(SmallVectorImpl< char > &buf)
wpi::SmallVectorImpl< char >
wpi::raw_istream
Definition:
raw_istream.h:22
wpi
Definition:
ntcore_cpp.h:26
string_view
basic_string_view< char > string_view
Definition:
base.h:601
wpi
sha1.h
Generated on Wed Jul 3 2024 17:20:03 for WPILibC++ by
1.9.4