Use ToHex to format digest results

This lets us get rid of the to_hex() helper function
and replace it with a library funtion that looks like
it likely performs better.