Verhoeff Checksum#

This module includes functions for Verhoeff checksum calculation and validation.

The functions in this module are available when OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE is enabled.

Functions#

otVerhoeffChecksumCalculate(const char *aDecimalString, char *aChecksum)

Calculates the Verhoeff checksum for a given decimal string.

otVerhoeffChecksumValidate(const char *aDecimalString)

Validates the Verhoeff checksum for a given decimal string.

Macros#

#define
OT_VERHOEFF_CHECKSUM_MAX_STRING_LENGTH 128

Specifies the maximum length of decimal string input in otVerhoeffChecksum functions.

Function Documentation#

otVerhoeffChecksumCalculate#

otError otVerhoeffChecksumCalculate (const char * aDecimalString, char * aChecksum)

Calculates the Verhoeff checksum for a given decimal string.

Parameters
TypeDirectionArgument NameDescription
const char *[in]aDecimalString

The string containing decimal digits.

char *[out]aChecksum

Pointer to a char to return the calculated checksum.

Requires OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE.


otVerhoeffChecksumValidate#

otError otVerhoeffChecksumValidate (const char * aDecimalString)

Validates the Verhoeff checksum for a given decimal string.

Parameters
TypeDirectionArgument NameDescription
const char *[in]aDecimalString

The string containing decimal digits (last char is treated as checksum).

Requires OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE.