Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string Record::IntToIPv6(std::string line)
- {
- uint64_t num = 0;
- char* endptr;
- num = strtoll(line.c_str(), &endptr, 10);
- std::ostringstream os;
- os << std::hex << std::setw( 16) << num;
- std::string ret = os.str();
- for (int i = 4; i < 15; i+=4) {
- ret.insert(i++, 1, ':');
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement