F´ Flight Software - C/C++ Documentation  NASA-v2.1.0
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  // Construction and destruction
30  // ----------------------------------------------------------------------
31 
34  Hash();
35 
38  ~Hash();
39 
40  public:
41 
42  // ----------------------------------------------------------------------
43  // Public static methods
44  // ----------------------------------------------------------------------
45 
50  static void hash(
51  const void *data,
52  const NATIVE_INT_TYPE len,
53  HashBuffer& buffer
54  );
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Public instance methods
60  // ----------------------------------------------------------------------
61 
64  void init(void);
65 
68  void setHashValue(
69  HashBuffer &value
70  );
71 
75  void update(
76  const void *const data,
77  const NATIVE_INT_TYPE len
78  );
79 
82  void final(
83  HashBuffer& buffer
84  );
85 
88  void final(U32 &hashvalue);
89 
93  static const char* getFileExtensionString(void);
94 
97  static void addFileExtension(
98  const Fw::StringBase& baseName,
99  Fw::StringBase& extendedName
100  );
101 
105 
106  private:
107 
108  // ----------------------------------------------------------------------
109  // Private member variables
110  // ----------------------------------------------------------------------
111 
114  HASH_HANDLE_TYPE hash_handle;
115 
116  };
117 
118 }
119 
120 #endif
StringType.hpp
Declares ISF string base class.
Fw::StringBase
Definition: StringType.hpp:23
Utils
Definition: CRCChecker.cpp:20
Utils::Hash::~Hash
~Hash()
Definition: CRC32.cpp:24
Utils::Hash::getFileExtensionLength
static NATIVE_UINT_TYPE getFileExtensionLength(void)
Definition: HashCommon.cpp:20
Utils::Hash::init
void init(void)
Definition: CRC32.cpp:47
Utils::HashBuffer
A container class for holding a hash buffer.
Definition: HashBuffer.hpp:26
Utils::Hash::getFileExtensionString
static const char * getFileExtensionString(void)
Definition: HashCommon.cpp:6
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Utils::Hash::setHashValue
void setHashValue(HashBuffer &value)
Definition: CRC32.cpp:82
Utils::Hash
A generic interface for creating and comparing hash values.
Definition: Hash.hpp:24
Utils::Hash::Hash
Hash()
Definition: CRC32.cpp:18
HASH_HANDLE_TYPE
#define HASH_HANDLE_TYPE
Definition: CRC32.hpp:12
Utils::Hash::update
void update(const void *const data, const NATIVE_INT_TYPE len)
Definition: CRC32.cpp:53
Utils::Hash::addFileExtension
static void addFileExtension(const Fw::StringBase &baseName, Fw::StringBase &extendedName)
Definition: HashCommon.cpp:12
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
HashBuffer.hpp
Utils::Hash::hash
static void hash(const void *data, const NATIVE_INT_TYPE len, HashBuffer &buffer)
Definition: CRC32.cpp:29