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 
17 #include "Fw/Types/StringType.hpp"
18 
19 namespace Utils {
20 
24 class Hash {
25  public:
26  // ----------------------------------------------------------------------
27  // Types
28  // ----------------------------------------------------------------------
29  public:
30  // ----------------------------------------------------------------------
31  // Construction and destruction
32  // ----------------------------------------------------------------------
33 
36  Hash();
37 
40  ~Hash();
41 
42  public:
43  // ----------------------------------------------------------------------
44  // Public static methods
45  // ----------------------------------------------------------------------
46 
51  static void hash(const void* data, const FwSizeType len, HashBuffer& buffer);
52 
53  public:
54  // ----------------------------------------------------------------------
55  // Public instance methods
56  // ----------------------------------------------------------------------
57 
60  void init();
61 
64  void setHashValue(HashBuffer& value
65  );
66 
70  void update(const void* const data, const FwSizeType len);
71 
74  void final(HashBuffer& buffer
75  );
76 
79  void final(U32& hashvalue);
80 
84  static const char* getFileExtensionString();
85 
88  static void addFileExtension(const Fw::StringBase& baseName,
89  Fw::StringBase& extendedName
90  );
91 
95 
96  private:
97  // ----------------------------------------------------------------------
98  // Private member variables
99  // ----------------------------------------------------------------------
100 
103  HASH_HANDLE_TYPE hash_handle;
104 };
105 
106 } // namespace Utils
107 
108 #endif
void update(const void *const data, const FwSizeType len)
Definition: CRC32.cpp:45
PlatformSizeType FwSizeType
static void addFileExtension(const Fw::StringBase &baseName, Fw::StringBase &extendedName)
Definition: HashCommon.cpp:9
#define HASH_HANDLE_TYPE
Definition: CRC32.hpp:12
void init()
Definition: CRC32.cpp:41
static FwSizeType getFileExtensionLength()
Definition: HashCommon.cpp:13
void setHashValue(HashBuffer &value)
Definition: CRC32.cpp:68
A generic interface for creating and comparing hash values.
Definition: Hash.hpp:24
static const char * getFileExtensionString()
Definition: HashCommon.cpp:5
static void hash(const void *data, const FwSizeType len, HashBuffer &buffer)
Definition: CRC32.cpp:25
A container class for holding a hash buffer.
Definition: HashBuffer.hpp:26