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 
30  // ----------------------------------------------------------------------
31  // Construction and destruction
32  // ----------------------------------------------------------------------
33 
36  Hash();
37 
40  ~Hash();
41 
42  // ----------------------------------------------------------------------
43  // Public static methods
44  // ----------------------------------------------------------------------
45 
50  static void hash(const void* data, const FwSizeType len, HashBuffer& buffer);
51 
52  // ----------------------------------------------------------------------
53  // Public instance methods
54  // ----------------------------------------------------------------------
55 
58  void init();
59 
62  void setHashValue(HashBuffer& value
63  );
64 
68  void update(const void* const data, const FwSizeType len);
69 
72  void finalize(HashBuffer& buffer
73  );
74 
77  void finalize(U32& hashvalue);
78 
82  static const char* getFileExtensionString();
83 
86  static void addFileExtension(const Fw::ConstStringBase& baseName,
87  Fw::StringBase& extendedName
88  );
89 
93 
94  private:
95  // ----------------------------------------------------------------------
96  // Private member variables
97  // ----------------------------------------------------------------------
98 
101  HASH_HANDLE_TYPE hash_handle;
102 };
103 
104 } // namespace Utils
105 
106 #endif
void update(const void *const data, const FwSizeType len)
Definition: CRC32.cpp:45
PlatformSizeType FwSizeType
#define HASH_HANDLE_TYPE
Definition: CRC32.hpp:12
void init()
Definition: CRC32.cpp:41
static FwSizeType getFileExtensionLength()
Definition: HashCommon.cpp:13
void finalize(HashBuffer &buffer)
Definition: CRC32.cpp:54
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 read-only abstract superclass for StringBase.
A container class for holding a hash buffer.
Definition: HashBuffer.hpp:26
static void addFileExtension(const Fw::ConstStringBase &baseName, Fw::StringBase &extendedName)
Definition: HashCommon.cpp:9