Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Luhn mod N algorithm for checksum in UVCI #38

Closed
martin-lindstrom opened this issue Apr 28, 2021 · 13 comments
Closed

Luhn mod N algorithm for checksum in UVCI #38

martin-lindstrom opened this issue Apr 28, 2021 · 13 comments
Labels
question Further information is requested
Milestone

Comments

@martin-lindstrom
Copy link
Contributor

Annex 2 in the eHN Vacc Interop spec specifies that the UCVI should have a checksum suffix according to the Luhn mod N-algorithm.

However, for interoperability, we need to be clear of the order of the allowed character set (A-Z 0-9 and '/', '#' and ':'). Each character needs to have code-point, and the spec isn't clear here. Should we read the following text:

Charset: Only uppercase US-ASCII alpha numerical characters (‘A’ to ‘Z’, ‘0’ to ’9’) are allowed; with additional special characters for separation from RFC39865, namely {'/','#',':'};

and understand that the order should be: ABCDEF....XYZ0123456789/#:

Or should use Ascii-ordering?

@martin-lindstrom martin-lindstrom added the question Further information is requested label Apr 28, 2021
@martin-lindstrom
Copy link
Contributor Author

I guess that tthe # character should be left out from the Luhn-algorithm since it is only allowed to be used as a delimiter for the Luhn control char.

@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

More than that: in medical data, different delimiters are used as standard: ' ^ ' and ' | ' being the most standard and most common. These need to be included.

Codepoints should indeed be defined for Luhn-mod-N and I think the charset description is an attempt at that.
So I would see explicitly:

ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/^|

eHN Vacc Interop spec, Annex 2:

  • Option 1 and Option 3 both explicitly require '/' as a field separator
  • Option 2 explicitly disallows it

(Note that the example given in #15 (comment) does NOT conform to the issued guidelines in Annex 2 as the example uses ' : ' explicilty as the field separator and is also in the regex pattern, but the eHN guidelines explicitly state that '/' is the separator)

@martin-lindstrom
Copy link
Contributor Author

More than that: in medical data, different delimiters are used as standard: ' ^ ' and ' | ' being the most standard and most common. These need to be included.

Codepoints should indeed be defined for Luhn-mod-N and I think the charset description is an attempt at that.
So I would see explicitly:

ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/^|

I don't understand how we ever will achieve interoperability if the specifications aren't clear and consise. So you mean that we shouldn't use what stated in annex 2?

eHN Vacc Interop spec, Annex 2:

  • Option 1 and Option 3 both explicitly require '/' as a field separator
  • Option 2 explicitly disallows it

No. Option 2 states: "
The opaque unique string should consist of alphanumeric characters exclusively; no other characters (e.g. “/”) are allowed."

But it doesn't explicitly state that '/' should be used as a delimitter.

(Note that the example given in #15 (comment) does NOT conform to the issued guidelines in Annex 2 as the example uses ' : ' explicilty as the field separator and is also in the regex pattern, but the eHN guidelines explicitly state that '/' is the separator)

Actually, what option 1 and 3 says is that '/' should be used as a delimitter for the blocks: issuing entity, (vaccine) and opaque unique string. It doesn't specify the delimitter for version and country.

So. The spec needs to be updated.

@dirkx
Copy link
Member

dirkx commented Apr 29, 2021 via email

@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

  • Option 2 explicitly disallows it

No. Option 2 states: "
The opaque unique string should consist of alphanumeric characters exclusively; no other characters (e.g. “/”) are allowed."

But it doesn't explicitly state that '/' should be used as a delimitter.

Annex 2 explicitly excludes it - as you quote:

no other characters (e.g. “/”) are allowed

@martin-lindstrom
Copy link
Contributor Author

Yes. No other characters are allowed in the actual opaque string. But there is nothing to delimit in opaque string.

@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

what exactly do we need to change in the document to fix this ?

  1. fully-defined codepoint set for UVCI - from above: you would need ' /:^| ' in there.
  2. would be good to have a clear choice for Option 1 or 2 or 3. From internal discussions, SemanticSG had a preference for Option 3.
  3. re-issue either a corrigenda or new doc - I suspect corrigenda? But I'll leave that to the process people to decide

@dirkx
Copy link
Member

dirkx commented Apr 29, 2021 via email

@dirkx
Copy link
Member

dirkx commented Apr 29, 2021 via email

@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

Actually, what option 1 and 3 says is that '/' should be used as a delimitter for the blocks: issuing entity, (vaccine) and opaque unique string. It doesn't specify the delimitter for version and country.

Indeed, those are missing in the doc but present in example #15

So. The spec needs to be updated.

Agree.

@martin-lindstrom
Copy link
Contributor Author

@dirkx Could you post an example of how a dutch ID would look like (including the Luhn control char)?

@jschlyter jschlyter added this to the Version 1.0 milestone Apr 29, 2021
@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

@gabywh
Copy link
Collaborator

gabywh commented Apr 29, 2021

Will close this one as we now just need the charset defined for Luhn-Mod-N, as per #45

@gabywh gabywh closed this as completed Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants