WPILibC++  unspecified
sha1.h
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 SHA1_HPP
21 #define SHA1_HPP
22 
23 
24 #include <cstdint>
25 #include <string>
26 #include "llvm/StringRef.h"
27 
28 namespace llvm {
29 template <typename T> class SmallVectorImpl;
30 }
31 
32 namespace wpi {
33 
34 class raw_istream;
35 
36 class SHA1
37 {
38 public:
39  SHA1();
40  void Update(llvm::StringRef s);
41  void Update(raw_istream &is);
42  std::string Final();
44  static std::string FromFile(llvm::StringRef filename);
45 
46 private:
47  uint32_t digest[5];
48  unsigned char buffer[64];
49  size_t buf_size;
50  uint64_t transforms;
51 };
52 
53 } // namespace wpi
54 
55 #endif /* SHA1_HPP */
Definition: Path.inc:27
Definition: SocketError.cpp:18
Definition: raw_istream.h:23
Definition: sha1.h:36
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42