Twitch SDK (Internal)
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 #pragma once
21 
22 #include <cstdint>
23 #include <iostream>
24 #include <string>
25 
26 namespace ttv
27 {
28  class SHA1;
29 }
30 
31 class ttv::SHA1
32 {
33 public:
34  SHA1();
35  void Update(const std::string &s);
36  void Update(std::istream &is);
37  std::string Final();
38 
39  static uint32_t HashAsUInt32(const std::string& hash);
40 
41 private:
42  uint32_t digest[5];
43  std::string buffer;
44  uint64_t transforms;
45 };
uint64_t transforms
Definition: sha1.h:44
Definition: sha1.h:31
static uint32_t HashAsUInt32(const std::string &hash)
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
std::string buffer
Definition: sha1.h:43
std::string Final()
void Update(const std::string &s)
uint32_t digest[5]
Definition: sha1.h:42