diff options
Diffstat (limited to 'Swiften/StringCodecs/Hexify.cpp')
-rw-r--r-- | Swiften/StringCodecs/Hexify.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/StringCodecs/Hexify.cpp b/Swiften/StringCodecs/Hexify.cpp index 8259912..c762d9b 100644 --- a/Swiften/StringCodecs/Hexify.cpp +++ b/Swiften/StringCodecs/Hexify.cpp @@ -15,6 +15,12 @@ namespace Swift { +String Hexify::hexify(unsigned char byte) { + std::ostringstream result; + result << std::hex << std::setw(2) << std::setfill('0') << boost::numeric_cast<unsigned int>(byte); + return String(result.str()); +} + String Hexify::hexify(const ByteArray& data) { std::ostringstream result; result << std::hex; |