| 246 | |
| 247 | |
| 248 | std::string WebSocket::computeAccept(const std::string& key) |
| 249 | { |
| 250 | std::string accept(key); |
| 251 | accept += WEBSOCKET_GUID; |
| 252 | Poco::SHA1Engine sha1; |
| 253 | sha1.update(accept); |
| 254 | Poco::DigestEngine::Digest d = sha1.digest(); |
| 255 | std::ostringstream ostr; |
| 256 | Poco::Base64Encoder base64(ostr); |
| 257 | base64.write(reinterpret_cast<const char*>(&d[0]), d.size()); |
| 258 | base64.close(); |
| 259 | return ostr.str(); |
| 260 | } |
| 261 | |
| 262 | |
| 263 | } } // namespace Poco::Net |