Moved common "tohex" functionality to centralized location
Authored by: artyom-beilis 2012-02-11
Parent: [r2110]
Child: [r2112]