-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Damm algorithm #114
Comments
This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions. |
Hi, I implemented three snippets of the Damm algorithm validation.
boolean damm(String s) {
int row = 0;
for (int i = 0; i < s.length(); i++) {
row = table[row][s.charAt(i) - '0'];
}
return row == 0;
}
boolean damm(String s) {
int row = 0;
for (var c : s.toCharArray()) {
row = table[row][c - '0'];
}
return row == 0;
}
boolean damm(String s) {
return s.chars().reduce(0, (row, col) -> table[row][col - '0']) == 0;
} |
This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions. |
In error detection, the Damm algorithm is a check digit algorithm that detects all single-digit errors and all adjacent transposition errors.
https://en.wikipedia.org/wiki/Damm_algorithm
The text was updated successfully, but these errors were encountered: