You.i Engine
YiCryptoUtility.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_CRYPTO_UTILITY_H_
3 #define _YI_CRYPTO_UTILITY_H_
4 
5 #include "utility/YiString.h"
6 
16 {
17 public:
29  {
30  friend class CYICryptoUtility;
31 
32  public:
38  void HashBytes(CYIStringView bytes);
39 
46 
47  private:
48  using InitializerFunc = void (*)(char *);
49  using AddBytesFunc = void (*)(char *, CYIStringView);
50  using FinalizerFunc = CYIString (*)(char *);
51  HashBuilder(InitializerFunc initializer, AddBytesFunc addBytes, FinalizerFunc finalizer);
52 
53  AddBytesFunc m_addBytesFunc;
54  FinalizerFunc m_finalizerFunc;
55  char m_opaque[112];
56  bool m_finalizeCalled;
57  };
58 
62  static CYIString MD5(CYIStringView data);
63 
67  static CYIString SHA1(CYIStringView data);
68 
72  static CYIString SHA256(CYIStringView data);
73 
78 
83 
88 
89 private:
90  CYICryptoUtility() = delete;
91 };
92 
97 #endif // _YI_CRYPTO_UTILITY_H_
static HashBuilder CreateMD5HashBuilder()
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
static HashBuilder CreateSHA256HashBuilder()
static CYIString SHA256(CYIStringView data)
friend class CYICryptoUtility
Definition: YiCryptoUtility.h:30
The CYICryptoUtility class contains utilities that are cryptographic in nature.
Definition: YiCryptoUtility.h:15
static CYIString SHA1(CYIStringView data)
static HashBuilder CreateSHA1HashBuilder()
static CYIString MD5(CYIStringView data)
Definition: YiCryptoUtility.h:28
void HashBytes(CYIStringView bytes)
A lightweight wrapper around a sequence of Unicode characters.
Definition: YiStringView.h:57