Created
November 16, 2018 14:31
-
-
Save Srushtika/153c9a34262fa0bad897c2ed8a4f6170 to your computer and use it in GitHub Desktop.
WebSockets server tutorial
This file contains hidden or 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
const crypto = require('crypto'); | |
function generateAcceptValue (acceptKey) { | |
return crypto | |
.createHash('sha1') | |
.update(acceptKey + '258EAFA5-E914–47DA-95CA-C5AB0DC85B11', 'binary') | |
.digest('base64'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Robdebert @Srushtika
.update(acceptKey + '258EAFA5-E914–47DA-95CA-C5AB0DC85B11', 'binary')
should be
.update(acceptKey + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', 'utf8')