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