plinehan / checkdigits Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/checkdigits
License: Other
Automatically exported from code.google.com/p/checkdigits
License: Other
Since it is not that hard to implement a Check Digit Scheme incorrectly it
would be very helpful to
publish a canonic set of "Testvectors" showing the checkdigits as calculated by
several algorithms.
This would it make easier to check if a new implementation or tweaking of an
existing
implementation broke anything.
This seems to be most urgently needed with Verhoeff's Dihedral Check Digit
since the different
implementations available on the net produce different results.
Original issue reported on code.google.com by [email protected]
on 29 Oct 2007 at 6:14
What steps will reproduce the problem?
1. Import CheckDigit.java, CheckISO7064Mod11_10, CheckCoreTest and
CheckISO7064Mod11_10Test files in new eclipse project
2. Run CheckISO7064Mod11_10Test as Java application
What is the expected output? What do you see instead?
Expected output is that all test are passed.
I see:
.....i=0, j=9, 00000000001, 00000000010
F.F
Time: 0,016
There were 2 failures:
1)
testBadAdjacentTraspositions(com.modp.checkdigits.test.CheckISO7064Mod11_10Test)
junit.framework.AssertionFailedError
at
com.modp.checkdigits.test.CheckCoreTest.testBadAdjacentTraspositions(CheckCoreTe
st.java:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
at
com.modp.checkdigits.test.CheckISO7064Mod11_10Test.main(CheckISO7064Mod11_10Test
.java:53)
2)
testBadVerify(com.modp.checkdigits.test.CheckISO7064Mod11_10Test)junit.framework
.AssertionFailedError
at
com.modp.checkdigits.test.CheckCoreTest.testBadVerify(CheckCoreTest.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
at
com.modp.checkdigits.test.CheckISO7064Mod11_10Test.main(CheckISO7064Mod11_10Test
.java:53)
FAILURES!!!
Tests run: 6, Failures: 2, Errors: 0
What version of the product are you using? On what operating system?
I use latest downloaded version (checkdigits-0.9.1.tar.gz). Operating
system is WinXp SP3
Please provide any additional information below.
HTML test passes with:
testCheck pass
testSingleError pass
testAdjacentTraspositions pass
testExample pass
Operation that are not in test HTML doesn't pass. Why is that?
Kind Regards,
Miroslav Rešetar
Original issue reported on code.google.com by [email protected]
on 24 Jun 2008 at 3:48
Do you dist. the artifacts to any maven repo?
If no - maybe you can go for this:
http://nexus.sonatype.org/oss-repository-hosting.html
making it easily available will probably increase usage.
Original issue reported on code.google.com by [email protected]
on 25 Feb 2011 at 7:20
Hi,
For CheckLuhnMod10.java I found that only some check digits were verified
correctly. When the amount of digits is odd verify would return false
incorrectly. An even amount of digits will work.
The reason is that the computeSum function does not strip the checkdigit
before calculating the Luhn value.
The JUnit test will not notice this since the cases are all an even 10
digits long.
In the method verify(String digits)
I used:
return (((computeSum(getData(digits)) + getCheckDigit(digits)) % 10) == 0);
instead of:
return ((computeSum(digits) % 10) == 0);
Which worked for my test code
CheckLuhnMod10 clm = new CheckLuhnMod10();
for (Long x=0L; x <= 20000L ; x++) {
String raw = x.toString()+"";
String cb = clm.computeCheck(raw)+"";
// print all instances where the verify returns false
if (!clm.verify(raw + cb)) System.out.println("["+raw+"|"+cb+"]");
}
p.s. I like your coding style
Original issue reported on code.google.com by [email protected]
on 26 Mar 2008 at 1:06
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.