Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reverse checksum
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00458981
Message ID:
00459023
Views:
17
>Are there any way to convert a checksum back to it's original character expression?

Hi, Vidar.

There is no a single implementation of a checksum, but it is, by definition, just a redundant measur to check a value, not an encoding algorithm.

I can write a checksum function for a string that gives me the average of each of it's ASCII values, for example ("ABCDE" -> "C")

The purpose of the checksum is to have som way to detect if the data had being corrupted somehow (for example after a transmission).

Following my example, you'll receive the string and the byte for checksum. You just have to calculate the letter average again and compare your result with my checksum.

Of course, you can revert from the checksum byte to the original string. Note also that the value of the checksum is that it tells you that something's WRONG if your result is different, but it doesn't give you CERTAINITY about the data being correct as in some cases (and depending of the algorithm, with more or less probability), corrupt data can reach the same checksum value. ("BACDE" -> "C").


Hope this helps.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform