diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-25 14:03:22 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-25 14:48:19 +0300 |
commit | 524c78a8d696e2ff980db7c60272032b4028864b (patch) | |
tree | 5562db8f2c93f6bdbfca5917094df34f5b20a52a | |
parent | e71262463f8fd2d9509b5646b4e08cfa09fc2889 (diff) | |
download | minetest-524c78a8d696e2ff980db7c60272032b4028864b.tar.gz minetest-524c78a8d696e2ff980db7c60272032b4028864b.tar.bz2 minetest-524c78a8d696e2ff980db7c60272032b4028864b.zip |
Add a variant of hex_encode
-rw-r--r-- | src/hex.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., static const char hex_chars[] = "0123456789abcdef"; -static std::string hex_encode(const char *data, unsigned int data_size) +static inline std::string hex_encode(const char *data, unsigned int data_size) { std::string ret; char buf2[3]; @@ -41,4 +41,9 @@ static std::string hex_encode(const char *data, unsigned int data_size) return ret; } +static inline std::string hex_encode(const std::string &data) +{ + return hex_encode(data.c_str(), data.size()); +} + #endif |