I got better details for my tast
So here is my REAL task. I need some algorithm for my documents code. Something similar to algorithm used in credit cards(
Luhn algorithm - Wikipedia, the free encyclopedia). I could use this one but i need something so i can use error correction too as i mention before. For correction i will need store some check code for each user. I need this because i want my system could work off-line(for example credit cards are valid when formula for calculation gives out 0).
example: user gives 123456789(his real number is 123456788). I check it vs my algorithm correct and give out: correct is 123456788 and there where mistake in 9 position.