F´ Flight Software - C/C++ Documentation  NASA-v1.5.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 
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 
48  static void hash(
49  const void *data,
50  const NATIVE_INT_TYPE len,
51  HashBuffer& buffer
52  );
53 
54  public:
55 
56  // ----------------------------------------------------------------------
57  // Public instance methods
58  // ----------------------------------------------------------------------
59 
62  void init(void);
63 
66  void setHashValue(
67  HashBuffer &value
68  );
69 
72  void update(
73  const void *const data,
74  const NATIVE_INT_TYPE len
75  );
76 
79  void final(
80  HashBuffer& buffer
81  );
82 
85  void final(U32 &hashvalue);
86 
90  static const char* getFileExtensionString(void);
91 
94  static void addFileExtension(
95  const Fw::EightyCharString& baseName,
96  Fw::EightyCharString& extendedName
97  );
98 
102 
103  private:
104 
105  // ----------------------------------------------------------------------
106  // Private member variables
107  // ----------------------------------------------------------------------
108 
111  HASH_HANDLE_TYPE hash_handle;
112 
113  };
114 
115 }
116 
117 #endif
Utils::Hash::addFileExtension
static void addFileExtension(const Fw::EightyCharString &baseName, Fw::EightyCharString &extendedName)
Definition: HashCommon.cpp:12
Utils
Definition: CRCChecker.cpp:20
Utils::Hash::~Hash
~Hash()
Definition: CRC32.cpp:24
Fw::EightyCharString
Definition: EightyCharString.hpp:10
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
An container class for holding a hash buffer.
Definition: HashBuffer.hpp:26
EightyCharString.hpp
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
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