Refactor get_hex to reduce complexity

Refactored the get_hex method in order to reduce the overall complexity by removing the case statement.
Merge pull request #2 from bplexico/patch-1

Refactor get_hex to reduce complexity