/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include #include #include #include namespace Swift { std::string ComponentHandshakeGenerator::getHandshake(const std::string& streamID, const std::string& secret) { std::string concatenatedString = streamID + secret; String::replaceAll(concatenatedString, '&', "&"); String::replaceAll(concatenatedString, '<', "<"); String::replaceAll(concatenatedString, '>', ">"); String::replaceAll(concatenatedString, '\'', "'"); String::replaceAll(concatenatedString, '"', """); return Hexify::hexify(SHA1::getHash(createByteArray(concatenatedString))); } }