From b60df56157ee1fd0bd4938799bac05a62fda91a1 Mon Sep 17 00:00:00 2001 From: lookshe Date: Sat, 14 Mar 2015 20:45:20 +0100 Subject: initial commit from working version --- .../flash-src/com/hurlant/crypto/hash/SHABase.as | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as') diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as new file mode 100644 index 0000000..dc9bafe --- /dev/null +++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as @@ -0,0 +1,71 @@ +/** + * SHABase + * + * An ActionScript 3 abstract class for the SHA family of hash functions + * Copyright (c) 2007 Henri Torgemane + * + * See LICENSE.txt for full license information. + */ +package com.hurlant.crypto.hash +{ + import flash.utils.ByteArray; + import flash.utils.Endian; + + public class SHABase implements IHash + { + + public function SHABase() { } + + public var pad_size:int = 40; + public function getInputSize():uint + { + return 64; + } + + public function getHashSize():uint + { + return 0; + } + + public function getPadSize():int + { + return pad_size; + } + + public function hash(src:ByteArray):ByteArray + { + var savedLength:uint = src.length; + var savedEndian:String = src.endian; + + src.endian = Endian.BIG_ENDIAN; + var len:uint = savedLength *8; + // pad to nearest int. + while (src.length%4!=0) { + src[src.length]=0; + } + // convert ByteArray to an array of uint + src.position=0; + var a:Array = []; + for (var i:uint=0;i