title: generate "Sec-WebSocket-Accept" from "Sec-WebSocket-Key"
body: <p>I'm following <a href="https://www.rfc-editor.org/rfc/rfc6455#section-1.3" rel="nofollow noreferrer">rfc6455</a>:</p>
  <blockquote>
  <p>Concretely, if as in the example above, the |Sec-WebSocket-Key|<br />
  header field had the value &quot;dGhlIHNhbXBsZSBub25jZQ==&quot;, the server<br />
  would concatenate the string &quot;258EAFA5-E914-47DA-95CA-C5AB0DC85B11&quot;<br />
  to form the string &quot;dGhlIHNhbXBsZSBub25jZQ==258EAFA5-E914-47DA-95CA-<br />
  C5AB0DC85B11&quot;.  The server would then take the SHA-1 hash of this,<br />
  giving the value 0xb3 0x7a 0x4f 0x2c 0xc0 0x62 0x4f 0x16 0x90 0xf6<br />
  0x46 0x06 0xcf 0x38 0x59 0x45 0xb2 0xbe 0xc4 0xea.  This value is<br />
  then base64-encoded (see Section 4 of [RFC4648]), to give the value<br />
  &quot;s3pPLMBiTxaQ9kYGzzhZRbK+xOo=&quot;.  This value would then be echoed in<br />
  the |Sec-WebSocket-Accept| header field.</p>
  </blockquote>
  <p>and fail to generate the correct &quot;Sec-WebSocket-Accept&quot;.</p>
  <p>In order to understand the process I'm using online <a href="http://www.sha1-online.com/" rel="nofollow noreferrer">SHA1 hash</a> and <a href="https://www.base64encode.org/" rel="nofollow noreferrer">Base64 Encode</a>.</p>
  <p>The <a href="http://www.sha1-online.com/" rel="nofollow noreferrer">online SHA1 hash</a> for &quot;dGhlIHNhbXBsZSBub25jZQ==258EAFA5-E914-47DA-95CA-C5AB0DC85B11&quot; give the correct result: &quot;b37a4f2cc0624f1690f64606cf385945b2bec4ea&quot; as described in rfc6455.</p>
  <p>But The <a href="https://www.base64encode.org/" rel="nofollow noreferrer">online Base64 Encode</a> give me the wrong results &quot;YjM3YTRmMmNjMDYyNGYxNjkwZjY0NjA2Y2YzODU5NDViMmJlYzRlYQ==&quot; for input &quot;b37a4f2cc0624f1690f64606cf385945b2bec4ea&quot;.
  The result should be &quot;s3pPLMBiTxaQ9kYGzzhZRbK+xOo=&quot;</p>
  <p>What am I doing wrong?</p>