File: README

package info (click to toggle)
eancheck 1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 132 kB
  • sloc: cpp: 195; makefile: 71
file content (41 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
RUBRIC
------
This is just a little program I hacked up in a few minutes. It takes in 
an EAN code as a command line argument and prints to STDOUT whether it 
is valid or not. It does this by performing a checksum on the supplied 
EAN.

It can also check:

 - UPC codes (12 digits), just preface them with a zero
 - Four digit codes (PLUs) which some supermarkets with older tills
   use on their till systems to ring up products like bread, fruit, veg...
   basically any loose product. Eancheck can validate them, no prefixing
   needed.

If you want to use the eancheck functions in a program, I invite you to
use eancheck.h in your programs. It provides two functions, one to check
check digits and another to generate them for a given EAN.

COMPATIBILITY
-------------
So far I have tested the main program on Windows and Linux, both times with
the G++ compiler. I have only tested the header file on Linux, but I assume
it works on Windows too.

USING EANCHECK.H
----------------
eancheck.h provides two functions you can use.

* int ec_checkean(char inputean[])
  This function takes an input EAN as a character array (string) and returns
  0 if the check digit is correct, 1 if it is incorrect and 3 if invalid
  characters were found in the string.
* int ec_gencd(char inputean[])
  This function takes an EAN without the check digit and returns either the
  check digit (from 0-9) or 10 if an invalid character was found.

LICENSING INFORMATION
---------------------
I don't care what you do with this code, it's a pissy little program. Do what
thou wilt.