WPILibC++ 2024.3.2
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
28namespace wpi {
29template <typename T>
30class SmallVectorImpl;
31class raw_istream;
32
33class SHA1 {
34 public:
38 std::string Final();
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_
Definition: sha1.h:33
std::string_view RawFinal(SmallVectorImpl< char > &buf)
static std::string FromFile(std::string_view filename)
void Update(std::string_view s)
std::string Final()
void Update(raw_istream &is)
std::string_view Final(SmallVectorImpl< char > &buf)
Definition: raw_istream.h:22
basic_string_view< char > string_view
Definition: core.h:501
Definition: ntcore_cpp.h:26