EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches

32-bit commit hash (e.g. from firmware) with byte-wise construction and string output. More...

#include <EnumerationInformation.hpp>

Public Member Functions

std::string toString () const
 Format hash as hex string.
bool operator== (const CommitHash &other) const noexcept
 Compare two commit hashes for equality.

Static Public Member Functions

static CommitHash fromBits (std::uint8_t a, std::uint8_t b, std::uint8_t c, std::uint8_t d) noexcept
 Build a CommitHash from four bytes (e.g. from enumeration response).

Public Attributes

std::uint32_t hash = 0
 32-bit hash value.

Friends

std::ostream & operator<< (std::ostream &os, const CommitHash &ch) noexcept
 Stream hash as hex string.

Detailed Description

32-bit commit hash (e.g. from firmware) with byte-wise construction and string output.

Member Function Documentation

◆ fromBits()

CommitHash eduart::CommitHash::fromBits ( std::uint8_t a,
std::uint8_t b,
std::uint8_t c,
std::uint8_t d )
staticnoexcept

Build a CommitHash from four bytes (e.g. from enumeration response).

Parameters
[in]aFirst byte.
[in]bSecond byte.
[in]cThird byte.
[in]dFourth byte.
Returns
CommitHash with hash = (a<<24)|(b<<16)|(c<<8)|d.

◆ operator==()

bool eduart::CommitHash::operator== ( const CommitHash & other) const
noexcept

Compare two commit hashes for equality.

Parameters
[in]otherCommitHash to compare with.
Returns
true if equal.

◆ toString()

std::string eduart::CommitHash::toString ( ) const

Format hash as hex string.

Returns
Hex representation of hash.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const CommitHash & ch )
friend

Stream hash as hex string.

Parameters
[in]osOutput stream.
[in]chCommitHash to print.
Returns
Reference to os.

The documentation for this struct was generated from the following file: