Skip to content

Commit

Permalink
Remove unused Verhoeff code (#26977)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored and pull[bot] committed Oct 27, 2023
1 parent 2d83901 commit 2530633
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 547 deletions.
3 changes: 0 additions & 3 deletions src/lib/support/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ static_library("support") {
"verhoeff/Verhoeff.cpp",
"verhoeff/Verhoeff.h",
"verhoeff/Verhoeff10.cpp",
"verhoeff/Verhoeff16.cpp",
"verhoeff/Verhoeff32.cpp",
"verhoeff/Verhoeff36.cpp",
]

if (current_os == "android" || matter_enable_java_compilation) {
Expand Down
113 changes: 0 additions & 113 deletions src/lib/support/verhoeff/Verhoeff.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,119 +70,6 @@ class DLL_EXPORT Verhoeff10
static const uint8_t sPermTable[];
};

// Verhoeff16 -- Implements Verhoeff's check-digit algorithm for base-16 (hex) strings.
//
class DLL_EXPORT Verhoeff16
{
friend class VerhoeffTest;

public:
enum
{
Base = 16,
PolygonSize = 8
};

// Compute a check character for a given string.
static char ComputeCheckChar(const char * str);
static char ComputeCheckChar(const char * str, size_t strLen);

// Verify a check character against a given string.
static bool ValidateCheckChar(char checkChar, const char * str);
static bool ValidateCheckChar(char checkChar, const char * str, size_t strLen);

// Verify a check character at the end of a given string.
static bool ValidateCheckChar(const char * str);
static bool ValidateCheckChar(const char * str, size_t strLen);

// Convert between a character and its corresponding value.
static int CharToVal(char ch);
static char ValToChar(int val);

private:
Verhoeff16() = delete;
~Verhoeff16() = delete;

static const uint8_t sMultiplyTable[];
static const uint8_t sPermTable[];
};

// Verhoeff32 -- Implements Verhoeff's check-digit algorithm for base-32 strings.
//
// Character Set (any case): 0-9, A-H, J-N, P, R-Y (excludes I, O, Q and Z).
//
class DLL_EXPORT Verhoeff32
{
friend class VerhoeffTest;

public:
enum
{
Base = 32,
PolygonSize = 16
};

// Compute a check character for a given string.
static char ComputeCheckChar(const char * str);
static char ComputeCheckChar(const char * str, size_t strLen);

// Verify a check character against a given string.
static bool ValidateCheckChar(char checkChar, const char * str);
static bool ValidateCheckChar(char checkChar, const char * str, size_t strLen);

// Verify a check character at the end of a given string.
static bool ValidateCheckChar(const char * str);
static bool ValidateCheckChar(const char * str, size_t strLen);

// Convert between a character and its corresponding value.
static int CharToVal(char ch);
static char ValToChar(int val);

private:
Verhoeff32() = delete;
~Verhoeff32() = delete;

static const uint8_t sMultiplyTable[];
static const uint8_t sPermTable[];
static const int8_t sCharToValTable[];
static const char sValToCharTable[];
};

// Verhoeff36 -- Implements Verhoeff's check-digit algorithm for base-36 strings.
//
// Character Set (any case) : 0-9, A-Z.
//
class DLL_EXPORT Verhoeff36
{
friend class VerhoeffTest;

public:
enum
{
Base = 36,
PolygonSize = 18
};

static char ComputeCheckChar(const char * str);
static char ComputeCheckChar(const char * str, size_t strLen);
static bool ValidateCheckChar(char checkChar, const char * str);
static bool ValidateCheckChar(char checkChar, const char * str, size_t strLen);
static bool ValidateCheckChar(const char * str);
static bool ValidateCheckChar(const char * str, size_t strLen);

static int CharToVal(char ch);
static char ValToChar(int val);

private:
Verhoeff36() = delete;
~Verhoeff36() = delete;

static const uint8_t sMultiplyTable[];
static const uint8_t sPermTable[];
static const int8_t sCharToValTable[];
static const char sValToCharTable[];
};

// Verhoeff -- Implements core functions for Verhoeff's algorithm.
//
class Verhoeff
Expand Down
123 changes: 0 additions & 123 deletions src/lib/support/verhoeff/Verhoeff16.cpp

This file was deleted.

Loading

0 comments on commit 2530633

Please sign in to comment.