To save space in the executable, I want to compute checksums (or hashes) over ASCII string and later use a checksum to look the corresponding string.
This saves space, since I don't have to fill up the executable with ASCII strings; instead only, say 32-bit integers are stored instead.
Now, for this idea to work, I need a checksum algorithm that is able to compute unique checksums for strings up to N
characters. Because, most of the strings are identifiers, N=20
would be acceptable.
Does anyone know of a checksum algorithm that satisfies my criteria?
Theory: Since a checksum algorithm maps {0,1}^* -> {0,1}^m
an infinite number of collisions exist in general. However, here I consider only strings of up to N
characters, so checksum (compress) algorithms mapping {0,1}^N -> {0,1}^m
, with N<=m
, are guaranteed to exist without collisions (injective).