F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Hash.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Hash.hpp
3 // \author dinkel
4 // \brief hpp file for Hash class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef UTILS_HASH_HPP
14 #define UTILS_HASH_HPP
15 
16 #include "Fw/Types/StringType.hpp"
18 
19 namespace Utils {
20 
24  class Hash {
25 
26  public:
27 
28  // ----------------------------------------------------------------------
29  // Types
30  // ----------------------------------------------------------------------
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Construction and destruction
35  // ----------------------------------------------------------------------
36 
39  Hash();
40 
43  ~Hash();
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Public static methods
49  // ----------------------------------------------------------------------
50 
55  static void hash(
56  const void *data,
57  const FwSizeType len,
58  HashBuffer& buffer
59  );
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Public instance methods
65  // ----------------------------------------------------------------------
66 
69  void init();
70 
73  void setHashValue(
74  HashBuffer &value
75  );
76 
80  void update(
81  const void *const data,
82  const FwSizeType len
83  );
84 
87  void final(
88  HashBuffer& buffer
89  );
90 
93  void final(U32 &hashvalue);
94 
98  static const char* getFileExtensionString();
99 
102  static void addFileExtension(
103  const Fw::StringBase& baseName,
104  Fw::StringBase& extendedName
105  );
106 
110 
111  private:
112 
113  // ----------------------------------------------------------------------
114  // Private member variables
115  // ----------------------------------------------------------------------
116 
119  HASH_HANDLE_TYPE hash_handle;
120 
121  };
122 
123 }
124 
125 #endif
void update(const void *const data, const FwSizeType len)
Definition: CRC32.cpp:56
PlatformSizeType FwSizeType
static void addFileExtension(const Fw::StringBase &baseName, Fw::StringBase &extendedName)
Definition: HashCommon.cpp:12
#define HASH_HANDLE_TYPE
Definition: CRC32.hpp:12
void init()
Definition: CRC32.cpp:50
static FwSizeType getFileExtensionLength()
Definition: HashCommon.cpp:20
void setHashValue(HashBuffer &value)
Definition: CRC32.cpp:85
A generic interface for creating and comparing hash values.
Definition: Hash.hpp:24
static const char * getFileExtensionString()
Definition: HashCommon.cpp:6
static void hash(const void *data, const FwSizeType len, HashBuffer &buffer)
Definition: CRC32.cpp:32
A container class for holding a hash buffer.
Definition: HashBuffer.hpp:26