From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- Source/WTF/wtf/HexNumber.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/WTF/wtf/HexNumber.h') diff --git a/Source/WTF/wtf/HexNumber.h b/Source/WTF/wtf/HexNumber.h index b698dd50e..741a8c1b5 100644 --- a/Source/WTF/wtf/HexNumber.h +++ b/Source/WTF/wtf/HexNumber.h @@ -78,6 +78,20 @@ inline void appendUnsignedAsHex(unsigned number, T& destination, HexConversionMo result.reverse(); destination.append(result.data(), result.size()); } + +template +inline void appendUnsigned64AsHex(uint64_t number, T& destination, HexConversionMode mode = Uppercase) +{ + const LChar* hexDigits = Internal::hexDigitsForMode(mode); + Vector result; + do { + result.append(hexDigits[number % 16]); + number >>= 4; + } while (number > 0); + + result.reverse(); + destination.append(result.data(), result.size()); +} // Same as appendUnsignedAsHex, but using exactly 'desiredDigits' for the conversion. template -- cgit v1.2.1