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 
34 
35  public:
36 
37  // ----------------------------------------------------------------------
38  // Construction and destruction
39  // ----------------------------------------------------------------------
40 
43  Hash();
44 
47  ~Hash();
48 
49  public:
50 
51  // ----------------------------------------------------------------------
52  // Public static methods
53  // ----------------------------------------------------------------------
54 
59  static void hash(
60  const void *data,
61  const FwSizeType len,
62  HashBuffer& buffer
63  );
64 
65  public:
66 
67  // ----------------------------------------------------------------------
68  // Public instance methods
69  // ----------------------------------------------------------------------
70 
73  void init();
74 
77  void setHashValue(
78  HashBuffer &value
79  );
80 
84  void update(
85  const void *const data,
86  const FwSizeType len
87  );
88 
91  void final(
92  HashBuffer& buffer
93  );
94 
97  void final(U32 &hashvalue);
98 
102  static const char* getFileExtensionString();
103 
106  static void addFileExtension(
107  const Fw::StringBase& baseName,
108  Fw::StringBase& extendedName
109  );
110 
114 
115  private:
116 
117  // ----------------------------------------------------------------------
118  // Private member variables
119  // ----------------------------------------------------------------------
120 
123  HASH_HANDLE_TYPE hash_handle;
124 
125  };
126 
127 }
128 
129 #endif
void update(const void *const data, const FwSizeType len)
Definition: CRC32.cpp:56
NATIVE_INT_TYPE SizeType
The size type.
Definition: Hash.hpp:33
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:70
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
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