In Belgium, banking transactions can use a structured communication, where a checksum guarantees the validity of the input.
The structure looks like this : +++ 085 / 1927 / 54115 +++
There are 10 digits, followed by a 2-digit checksum being the modulo 97 of the previous 10 digits.
Ex: 0851927541 % 97 = 15
usingIndriApollo.BelgianStructuredCommunication;vara=newCommunication(0123456789);Console.WriteLine(a.ToString());// +++012/3456/78939+++varb=Communication.Parse("+++ 012 / 3456 / 78939 +++");Console.WriteLine(b.Digits);// 123456789Console.WriteLine(b.CheckSum);// 39Console.WriteLine(b.ValidChecksum);// True// Parsing can succeed, but the checksum might be wrong.// In that case :// * TryParse will parse the digits and set ValidChecksum to false// * Parse will throw an InvalidChecksumExceptionvarr=Communication.TryParse("+++012/3456/78900 +++",outvarc);Console.WriteLine(r);// TrueConsole.WriteLine(c!.ValidChecksum);// False