Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Verhoeff code #26977

Merged
merged 2 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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