Created
January 8, 2017 18:10
-
-
Save thomasuster/a5dd68c2cf93f3280ab97526b193ff3c 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
package com.thomasuster.ws; | |
import haxe.io.Bytes; | |
import haxe.crypto.Sha1; | |
import haxe.crypto.Base64; | |
class HandShaker { | |
public function new() {} | |
public function shake(key:String):String { | |
var magic:String = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; | |
var concated:Bytes = Bytes.ofString(key+magic); | |
return Base64.encode(Sha1.make(concated)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment