26 Nov
2007
26 Nov
'07
12:41 p.m.
On 11/26/07, Zara
On Sun, 25 Nov 2007 21:13:15 +0100, "Stefan Arentz"
wrote: Is there something in Boost that can help me decode hex strings into binary form? For example hexadecimal strings that contain MD5 hashes.
S.
Yoy may divide the hex string into shorter parts that fit within un unsigned long and read them into unsigned long using std::istream, then convert them into std::bitset or boost::dynamic_bitset, and further convert them into binary representation using std::ostream.
Sure. I'm doing the conversion manually now, but I had hoped for some kind of 'codec' component in Boost. Now it's hex but maybe later I need to decode/encode base64 for example. It sounds like a good candidate for a future library. S.