FASC-N Question
Return to FASC-N Solution trustbearer-FASC-N-question.txt.zip
FASC-N Question
The Federal Agency Smart Credential Number (FASC-N) is an identifier used as the primary identification string on all government issued credentials. (see sections 6.2-6.3, pages 25-28, of the TIG-SCEPACS for reference). The decoded form of a FASC-N value consists of a "start sentinel" (left bracket "["), some decimal digits, some "field separators" (dash "-"), and an "end sentinel" (right bracket "]"). These characters are mapped to sequences of five bits to form the encoded representation of the FASC-N; see the attached documentation for exactly how this is done. Because these values are meant to be encoded on magnetic stripes, error checking is present in each one of the encoded characters' bitstrings, and also for the encodedbitstring as a whole: the final five-bit sequence (the LRC {ed. note: in the original it calls it an "LRC byte" but it's not a byte, just fivebits}) is specially constructed based on the other bitstrings. The resultant 25-byte encoded bit sequence can be hex-encoded as shown below.
Definitions for this question:
Example from TIG-SCEPACS (sanity check):
Another example:
In the language of your choice write a FASC-N encoder / decoder to convert between the decoded format and the hex-encoded representation. After your program is complete:
| ||||||