Skip to content
Snippets Groups Projects
Commit a03a64be authored by Dan Minor's avatar Dan Minor
Browse files

Bug 1552755 - Add ToHex to stringutils.h; r=ng

This was added in commit 74395345e8d2fecd504cb687eb79deee4ef394c3, but this
only cherry picks the ToHex part of that commit.

Depends on D33336

Differential Revision: https://phabricator.services.mozilla.com/D33337

--HG--
extra : moz-landing-system : lando
parent 3a63433a
No related branches found
No related tags found
No related merge requests found
......@@ -130,4 +130,11 @@ std::string string_trim(const std::string& s) {
return s.substr(first, last - first + 1);
}
std::string ToHex(const int i) {
char buffer[50];
snprintf(buffer, sizeof(buffer), "%x", i);
return std::string(buffer);
}
} // namespace rtc
......@@ -311,6 +311,9 @@ bool ends_with(const char *s1, const char *s2);
// Remove leading and trailing whitespaces.
std::string string_trim(const std::string& s);
// TODO(jonasolsson): replace with absl::Hex when that becomes available.
std::string ToHex(const int i);
} // namespace rtc
#endif // RTC_BASE_STRINGUTILS_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment