F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Utils::Hash Class Reference

A generic interface for creating and comparing hash values. More...

#include <Utils/Hash/Hash.hpp>

Public Member Functions

 Hash ()
 
 ~Hash ()
 
void init ()
 
void setHashValue (HashBuffer &value)
 
void setHashValue (U32 value)
 
void update (const void *const data, const FwSizeType len)
 
void finalize (HashBuffer &buffer) const
 
void finalize (U32 &hashvalue) const
 

Static Public Member Functions

static void hash (const void *data, const FwSizeType len, HashBuffer &buffer)
 
static const char * getFileExtensionString ()
 
static void addFileExtension (const Fw::ConstStringBase &baseName, Fw::StringBase &extendedName)
 
static FwSizeType getFileExtensionLength ()
 

Detailed Description

A generic interface for creating and comparing hash values.

Definition at line 24 of file Hash.hpp.

Constructor & Destructor Documentation

◆ Hash()

Utils::Hash::Hash ( )

Construct a Hash object

Definition at line 18 of file HashImpl.cpp.

◆ ~Hash()

Utils::Hash::~Hash ( )
default

Destroy a Hash object

Definition at line 21 of file SHA256.cpp.

Member Function Documentation

◆ addFileExtension()

void Utils::Hash::addFileExtension ( const Fw::ConstStringBase baseName,
Fw::StringBase extendedName 
)
static

Add the extension for the supported hash type

Parameters
baseNameThe base name
extendedNameThe extended name

Definition at line 9 of file HashCommon.cpp.

◆ finalize() [1/2]

void Utils::Hash::finalize ( HashBuffer buffer) const

Finalize an incremental computation and return the result

Parameters
bufferThe result

Definition at line 40 of file HashImpl.cpp.

◆ finalize() [2/2]

void Utils::Hash::finalize ( U32 &  hashvalue) const

Finalize an incremental computation and return the result

Definition at line 48 of file HashImpl.cpp.

◆ getFileExtensionLength()

FwSizeType Utils::Hash::getFileExtensionLength ( )
static

Get the length of the file extension string

Definition at line 13 of file HashCommon.cpp.

◆ getFileExtensionString()

const char * Utils::Hash::getFileExtensionString ( )
static

Get the file extension for the supported hash type E.g., could return "SHA256"

Definition at line 5 of file HashCommon.cpp.

◆ hash()

void Utils::Hash::hash ( const void *  data,
const FwSizeType  len,
HashBuffer buffer 
)
static

Create a hash value all at once from raw data

Parameters
datapointer to start of data
lenlength of the data
bufferfilled with resulting hash value

Definition at line 24 of file HashImpl.cpp.

◆ init()

void Utils::Hash::init ( )

Initialize a Hash object for incremental hash computation

Definition at line 30 of file HashImpl.cpp.

◆ setHashValue() [1/2]

void Utils::Hash::setHashValue ( HashBuffer value)

Set hash value to specified value

Parameters
valueHash value

Definition at line 53 of file HashImpl.cpp.

◆ setHashValue() [2/2]

void Utils::Hash::setHashValue ( U32  value)

Set hash value to specified value

Parameters
valueHash value

Definition at line 61 of file HashImpl.cpp.

◆ update()

void Utils::Hash::update ( const void *const  data,
const FwSizeType  len 
)

Update an incremental computation with new data

Parameters
datapointer to start of data to add to hash calculation
lenlength of data to add to hash calculation

Definition at line 34 of file HashImpl.cpp.


The documentation for this class was generated from the following files: