You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Benedikt Ritter <br...@apache.org> on 2016/05/03 22:49:52 UTC

[VALIDATOR] CheckDigit implementation for German identity cards?

Hello,

I have the need for a validator implementation that can check German
identity card numbers. It's pretty simple to implement something like this
using ModulusCheckDigit. Now I'm wondering whether this would be a good
addition for [validator]. It is specific to German identity cards, but
maybe we could start an idcard package which contains routine for different
country identity cards.

If this doesn't belong into [validator] I'll probably publish it via my
github account :-)

Best regards,
Benedikt

Re: [VALIDATOR] CheckDigit implementation for German identity cards?

Posted by sebb <se...@gmail.com>.
On 5 May 2016 at 20:50, Gary Gregory <ga...@gmail.com> wrote:
> I wonder if we should have packages for various country codes like
> o.a.c.validator.de ? Then this class would go in there.

Seems excessive to have a separate package for a single class file.

> Gary
>
> On Thu, May 5, 2016 at 12:46 PM, Benedikt Ritter <br...@apache.org> wrote:
>
>> Benedikt Ritter <br...@apache.org> schrieb am Di., 3. Mai 2016 um
>> 22:49 Uhr:
>>
>> > Hello,
>> >
>> > I have the need for a validator implementation that can check German
>> > identity card numbers. It's pretty simple to implement something like
>> this
>> > using ModulusCheckDigit. Now I'm wondering whether this would be a good
>> > addition for [validator]. It is specific to German identity cards, but
>> > maybe we could start an idcard package which contains routine for
>> different
>> > country identity cards.
>> >
>> > If this doesn't belong into [validator] I'll probably publish it via my
>> > github account :-)
>> >
>>
>> A CheckDigit implementation for German identity card numbers would look
>> like this:
>> https://gist.github.com/britter/ff959c42cab142a828247ce0673f6215
>>
>>
>> >
>> > Best regards,
>> > Benedikt
>> >
>> >
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [VALIDATOR] CheckDigit implementation for German identity cards?

Posted by Gary Gregory <ga...@gmail.com>.
I wonder if we should have packages for various country codes like
o.a.c.validator.de ? Then this class would go in there.

Gary

On Thu, May 5, 2016 at 12:46 PM, Benedikt Ritter <br...@apache.org> wrote:

> Benedikt Ritter <br...@apache.org> schrieb am Di., 3. Mai 2016 um
> 22:49 Uhr:
>
> > Hello,
> >
> > I have the need for a validator implementation that can check German
> > identity card numbers. It's pretty simple to implement something like
> this
> > using ModulusCheckDigit. Now I'm wondering whether this would be a good
> > addition for [validator]. It is specific to German identity cards, but
> > maybe we could start an idcard package which contains routine for
> different
> > country identity cards.
> >
> > If this doesn't belong into [validator] I'll probably publish it via my
> > github account :-)
> >
>
> A CheckDigit implementation for German identity card numbers would look
> like this:
> https://gist.github.com/britter/ff959c42cab142a828247ce0673f6215
>
>
> >
> > Best regards,
> > Benedikt
> >
> >
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [VALIDATOR] CheckDigit implementation for German identity cards?

Posted by Niall Pemberton <ni...@gmail.com>.
On Fri, May 6, 2016 at 9:33 AM, sebb <se...@gmail.com> wrote:

> On 5 May 2016 at 20:46, Benedikt Ritter <br...@apache.org> wrote:
> > Benedikt Ritter <br...@apache.org> schrieb am Di., 3. Mai 2016 um
> > 22:49 Uhr:
> >
> >> Hello,
> >>
> >> I have the need for a validator implementation that can check German
> >> identity card numbers. It's pretty simple to implement something like
> this
> >> using ModulusCheckDigit. Now I'm wondering whether this would be a good
> >> addition for [validator]. It is specific to German identity cards, but
> >> maybe we could start an idcard package which contains routine for
> different
> >> country identity cards.
> >>
> >> If this doesn't belong into [validator] I'll probably publish it via my
> >> github account :-)
> >>
> >
> > A CheckDigit implementation for German identity card numbers would look
> > like this:
> https://gist.github.com/britter/ff959c42cab142a828247ce0673f6215
>
> Looks like some/most of the code could be used in other check digit
> implementations.
> In which case the routines should be pushed up into a superclass and
> the German version could just be a constant instance.
> As is done with the bank cards.
>

Yes, a generic "Modulus 10" Check Digit implementation could do this. I've
created the following ticket with an implementation attached:

https://issues.apache.org/jira/browse/VALIDATOR-394

Niall


>
> >
> >>
> >> Best regards,
> >> Benedikt
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [VALIDATOR] CheckDigit implementation for German identity cards?

Posted by sebb <se...@gmail.com>.
On 5 May 2016 at 20:46, Benedikt Ritter <br...@apache.org> wrote:
> Benedikt Ritter <br...@apache.org> schrieb am Di., 3. Mai 2016 um
> 22:49 Uhr:
>
>> Hello,
>>
>> I have the need for a validator implementation that can check German
>> identity card numbers. It's pretty simple to implement something like this
>> using ModulusCheckDigit. Now I'm wondering whether this would be a good
>> addition for [validator]. It is specific to German identity cards, but
>> maybe we could start an idcard package which contains routine for different
>> country identity cards.
>>
>> If this doesn't belong into [validator] I'll probably publish it via my
>> github account :-)
>>
>
> A CheckDigit implementation for German identity card numbers would look
> like this: https://gist.github.com/britter/ff959c42cab142a828247ce0673f6215

Looks like some/most of the code could be used in other check digit
implementations.
In which case the routines should be pushed up into a superclass and
the German version could just be a constant instance.
As is done with the bank cards.

>
>>
>> Best regards,
>> Benedikt
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [VALIDATOR] CheckDigit implementation for German identity cards?

Posted by Benedikt Ritter <br...@apache.org>.
Benedikt Ritter <br...@apache.org> schrieb am Di., 3. Mai 2016 um
22:49 Uhr:

> Hello,
>
> I have the need for a validator implementation that can check German
> identity card numbers. It's pretty simple to implement something like this
> using ModulusCheckDigit. Now I'm wondering whether this would be a good
> addition for [validator]. It is specific to German identity cards, but
> maybe we could start an idcard package which contains routine for different
> country identity cards.
>
> If this doesn't belong into [validator] I'll probably publish it via my
> github account :-)
>

A CheckDigit implementation for German identity card numbers would look
like this: https://gist.github.com/britter/ff959c42cab142a828247ce0673f6215


>
> Best regards,
> Benedikt
>
>