Boost logo

Boost Users :

Subject: [Boost-users] Google summer of Code 2011 - would a collection of checksums, checkdigits be a useful project?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-01-30 12:24:20


I have posted some tentative ideas for a GSoC project to create a collection
of functions to create and validate check digits at

 https://svn.boost.org/trac/boost/wiki/SoC2011

Previous discussions suggested that many people might find these useful.

Some possible existing systems in wide user are :

   Simple modulo 256 etc check values and digits.
http://en.wikipedia.org/wiki/Cyclic_redundancy_check

   http://www.boost.org/doc/libs/1_45_0/libs/crc/crc.html
   Boost's Cyclic redundancy checks codes
http://www.boost.org/doc/libs/1_45_0/libs/crc/index.html

  http://www.netrino.com/Embedded-Systems/How-To/CRC-Calculation-C-Code

  crc_16_type BISYNCH, ARC
  crc_ccitt_type designated by CCITT (Comité Consultatif
International Télégraphique et Téléphonique)
  crc_xmodem_type XMODEM
  crc_32_type PKZip, AUTODIN II, Ethernet, FDDI

    MD5 hash http://www.md5.net/

    SHA hashes http://en.wikipedia.org/wiki/SHA-1 ...

    Luhn algorithm http://en.wikipedia.org/wiki/Luhn_algorithm

    Verhoeff algorithm http://en.wikipedia.org/wiki/Verhoeff_algorithm

    (These two are used by many of the others below).

    European Article numbering EAN Symbol Specification Manual,

    Universal Product Code, Uniform Code Council, Dayton, Ohio, USA.

    Version of check used by Mastercard, VISA, and most other credit card
companies. http://www.beachnet.com/~hstiles/cardtype.html

    Generalised to arbitrary radix version allowing any characters (not just
digits). Gene Callahan, Dr Dobb's Journal, Dec 1995, 131, 132 & 149.
Generating Sequential keys in an Arbitrary Radix.

    IBAN International Banking format
http://en.wikipedia.org/wiki/International_Bank_Account_Number

     http://en.wikipedia.org/wiki/Machine-readable_passport check digit

    US driving licence

    US Social security numbers

    Canadian Social Insurance Numbers

    UK National Insurance number

    ISBN http://en.wikipedia.org/wiki/International_Standard_Book_Number

    ISSN http://en.wikipedia.org/wiki/International_Standard_Serial_Number

    POSTNET http://en.wikipedia.org/wiki/POSTNET

    Bar codes http://www.dlsoft.com/services/CheckCalc/

     http://en.wikipedia.org/wiki/Check_digit#Other_examples_of_check_digits

    Chemical abstracts http://en.wikipedia.org/wiki/CAS_registry_number

    Vehicle Id Number
http://en.wikipedia.org/wiki/Vehicle_identification_number

    And there are no doubt many, many more. Suggestions?

A question that Boost users/ developers/gurus might to comment on is the
format these should take.

Should it something naïve like

bool ISBNcheck(string); // return true if is a full valid ISBN with correct
decimal digit or X check digit.
char ISBNcompute(string); // return the decimal digit or X check digit of
the ISBN number passed.

and similarly for the other check systems.

or do we need something more complicated? String or Arrays of (unsigned?)
bytes or? (Most of these examples *are* short strings). What return type?
Efficiency is not like to be an issue for many of these?

(Boost.crc handles this in a much more generic and complex package but
handles some popular types.
Some of its examples could be packaged simply as above.)

Views?

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net