A possible improvement could be to use this method to initialize the application to creating a table with all bytes and its inverted value.
Paying a slower initialization and more memory consumption all the conversions at runtime would be much faster.