Pull request #562 was rejected because it introduced a new ToHex function with a different, potentially less safe interface.
This pull request gives most of the speed-up (~30x on my CPU) of @JoelKatz his patch but rolls it into the current HexStr function. See the following benchmark results (made using https://gist.github.com/2439041).
Testing HexStrOld (1000000 iterations)
-> 14120.0 ms
Testing HexStrNew (1000000 iterations)
-> 470.0 ms
Testing ToHex (1000000 iterations)
-> 100.0 ms
It also adds two tests for HexStr: testing HexStr for the empty string and the function that takes a std::vector.