I\'m working on an online event ticketing system, where users will be able to self print his tickets and show up at the event where it will be scanned (barcode) and ideally
You could do a CRC calculation.
Basically, just start to add each character in the string, and limit the length to a long integer.
You may start with a known random number and store it in the first 4 bytes, and have the last four be a calculation as I described earlier.
This would be two ints, or eight bytes.