EEPROM-Storage Library
The EEPROM Storage library provides the ability to access variables stored in EEPROM just as if they were stored in RAM.
 
Loading...
Searching...
No Matches
Checksum< T > Class Template Reference

Provides checksum calculation options. More...

#include <EEPROM-Checksum.h>

Static Public Member Functions

static byte get (byte *data, uint length)
 Calculate the checksum of a byte array.
 
static byte getEEPROM (uint address, uint length)
 Calculates the checksum from data in the EEPROM.
 
static byte get (T value)
 Calculates the checksum of the value of T.
 

Detailed Description

template<typename T>
class Checksum< T >

Provides checksum calculation options.

Computes a single-byte checksum on any data type or directly from an EEPROM address.

Template Parameters
TThe type of the variable against whose value the checksum will be calculated.

Definition at line 46 of file EEPROM-Checksum.h.

Member Function Documentation

◆ get() [1/2]

template<typename T >
static byte Checksum< T >::get ( byte *  data,
uint  length 
)
inlinestatic

Calculate the checksum of a byte array.

Calculate the checksum of the byte array specified by the data parameter whose number of bytes is specified by the length parameter.

Parameters
dataPoints to the starting byte in the array.
lengthThe length of the byte array.
Returns
The calculated checksum as a byte.

Definition at line 58 of file EEPROM-Checksum.h.

◆ get() [2/2]

template<typename T >
static byte Checksum< T >::get ( value)
inlinestatic

Calculates the checksum of the value of T.

Parameters
valueThe value whose checksum will be calculated.
Returns
The calculated checksum as a byte.

Definition at line 136 of file EEPROM-Checksum.h.

◆ getEEPROM()

template<typename T >
static byte Checksum< T >::getEEPROM ( uint  address,
uint  length 
)
inlinestatic

Calculates the checksum from data in the EEPROM.

Calculate the checksum of the byte array in EEPROM specified by the address parameter whose number of bytes is specified by the length parameter.

Parameters
addressThe EEPROM address of the first byte of the array.
lengthThe number of EEPROM bytes to read.
Returns
The calculated checksum as a byte.

Definition at line 99 of file EEPROM-Checksum.h.


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