Old DCI Number Conversion
Older (smaller) DCI numbers will need to be converted into the new format. Currently don't know the formula to do this, though.
I'll ask my judge friends to find out how to do the conversion.
http://pastebin.com/PG59ZsJ7
The process for generating DCI numbers is:
Prepend a zero Calculate check digit Prepend that check digit (and repeat until full length DCI number)
Wow, that's complicated.
On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.
Totally! They have the most complicated check digit system I have ever seen. O_o But now can validate all DCI numbers, which is pretty sweet. :)
On Sep 29, 2014, at 4:03 PM, Jordan [email protected] wrote:
Wow, that's complicated.
On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.
— Reply to this email directly or view it on GitHub.
Alrighty, just checking in on this again, since I'm nearly done with the validation methods for #5, and I want to be sure they're all working before implementing the display status and tooltips for the fields.
As I understand this, the code in the pastebin does two things:
- Determines if a given DCI number is valid (using
sum). - Determines what the next digit for a given number would be for it to be a valid DCI number.
With that in mind, we could effectively break it up into those two parts - one for validation and one for check digit generation?
From there, we can use part 1 to check a given number. If it's an invalid number, the process is to prepend a 0 and use part 2 to get a valid number, and that's it, regardless of length? Or do we repeat that until a 9- or 10-digit number, exactly is reached?
@Nightfirecat after doing some research, there seem to be 3 kinds of numbers
- Older <8 digit numbers - no checksum
- Intermediate 8 digit numbers
- Current 10 digit numbers
- conversion from 1 to 2 is prepend zeros to get to 7 digits, then prepend a check digit
- conversion 2 to 3 is prepend a zero, prepend a check digit
for a 1 you do both steps
I'm planning to take a shot at it now.
@Nightfirecat @april
I think I got everything except the wording for the warning message for shorter (older) dci numbers.
Currently: DCI Numbers with less than 8 digits cannot be validated
Previously: Older DCI Numbers cannot be validated
But neither one is quite what I want.
I'm leaning toward wanting this to be a warning (eg. We recommend updating your DCI number to xxx, as it is currently in an old format) rather than a hard-and-fast error. That said, something like this would also be fine in my mind: We recommend updating your DCI number to xxx, as DCI numbers with fewer than 8 digits are in an old format.
Current behavior is convert and warning.
The issue is that they don't have a checksum, so theoretically they could have an entry error that is another valid number (someone else's) that then gets compounded by doing the conversion process on the wrong number.
With a 8/10 digit number, the checksum can be validated, but with a <8 digit, there is simply no way to check. (unless we can get wizards to give us an api endpoint)
@Nightfirecat
I really want to say somthin to the effect of We cannot verify that your dci# is valid as it is in an old format. Please double-check and/or use the 8 or 10 digit form of your number.
oh, and to be clear, this is in pr #29
I'd like to see the DCI number validation become optional, like with a checkbox below the DCI number input textbox that reads "Validate my DCI Number", checked by default. Two reasons:
-
Out of pure vanity, I have a four-digit DCI number that I like to show off and it doesn't need validation. It goes into WER just fine as a four-digit number and I like the ooohs and aaahs from scorekeepers. Plus it's less for them to type.
-
WER (at least in offline mode, have yet to test it in online mode) doesn't handle the 10-digit DCI number and 4-digit number correctly. If I enter a tournament using the "validated" 10-digit DCI number and then enter another player with the original 4-digit DCI number (supposedly the same player, right?) it actually enters them as two separate players. I can get paired up against myself!
If I understand it correctly there are two steps performed automatically right now:
- check if entered number is in an expected dci number format (digits + checksum check i guess?)
- if not and/or too long: print error
- if too short: convert given number to 10 digits version (which allows to validate them because of the included checksum)
We still never know if it is a real or valid DCI number, correct? It's just checked if it's form/style matches a theoretical real number from wizards?
@tooomm basically, yes to all
I'm okay with just validating and warning, without changing the official number in the PDF. Any objections to that?
Seems reasonable, I can do that in a little bit.
So you prefer to remove the expand to 10 digits "feature" completely? @april
Or do you want to make the conversion an optional selection?
If the second... it could be an expanded warning message instead an option present to everybody next to the DCI field to keep the interface clean - just a huge minority is using the old numbers I would assume:
Your DCI number isn't valid regarding new 10 digits conventions. If you're using an old, shorter number and prefer the new style - (we can convert it for you!) with the last part clickable.
Or any other suitable shorter phrase for the warning. :)
The expanded warning message as alternative was just my first idea, there are other options too, I'm sure.
Closed via #29? Unless we want to change the behavior to "Don't change the number entered, but notify user of the expanded 10-digit number"
It's a bit confusing when a user enters an old (short) DCI number and it gets changed with no warning.
Plus, I believe those are still valid even without the expansion to 10 digits.
Would be better to do as @tooomm suggests, make it a button and optionally convert.
I actually have time now, so I'll probably work on it this week.