-
-
Save yrashk/1e096b658097c19cf309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) | |
{ | |
std::string result; | |
if (uuid.isNull()) { | |
//VIVOX, the uuid emtpy look for the mURIString and return that instead. | |
//result.assign(uuid.mURIStringName); | |
LLStringUtil::replaceChar(result, '_', ' '); | |
return result; | |
} | |
// Prepending this apparently prevents conflicts with reserved names inside the vivox code. | |
result = "x"; | |
// Base64 encode and replace the pieces of base64 that are less compatible | |
// with e-mail local-parts. | |
// See RFC-4648 "Base 64 Encoding with URL and Filename Safe Alphabet" | |
result += LLBase64::encode(uuid.mData, UUID_BYTES); | |
LLStringUtil::replaceChar(result, '+', '-'); | |
LLStringUtil::replaceChar(result, '/', '_'); | |
// If you need to transform a GUID to this form on the Mac OS X command line, this will do so: | |
// echo -n x && (echo e669132a-6c43-4ee1-a78d-6c82fff59f32 |xxd -r -p |openssl base64|tr '/+' '_-') | |
// The reverse transform can be done with: | |
// echo 'x5mkTKmxDTuGnjWyC__WfMg==' |cut -b 2- -|tr '_-' '/+' |openssl base64 -d|xxd -p | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment