Git Product home page Git Product logo

checkdigits's People

Stargazers

 avatar

Watchers

 avatar

checkdigits's Issues

Testvectors are missing

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

CheckISO7064Mod11_10Test fails

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

Maven repo dist

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

CheckLuhnMod10.java verify() only works partially

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.