A product code generator ported from Delphi