Created
June 1, 2015 09:13
-
-
Save hachibeeDI/0a00abd18117541cb849 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>使い捨てパッド暗号化</title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
html, body { | |
margin: 0; padding: 0; | |
background-color: #FEFEFE; | |
} | |
.main { | |
min-width: 320px; | |
width: 70%; | |
margin: auto; | |
} | |
.field { | |
display: block; | |
margin: 10px 0; | |
} | |
.field input[type="text"] { | |
width: 700px; | |
} | |
.label__description { | |
display: inline-block; | |
width: 230px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="main"> | |
<h1>使い捨てパッド暗号化</h1> | |
<label class="field" for="words"> | |
<span class="label__description">入力してください</span> | |
<input type="text" name="" id="words"> | |
</label> | |
<label class="field" for="bin-words"> | |
<span class="label__description">バイナリ化した物です</span> | |
<input type="text" name="" readonly id="bin-words"> | |
</label> | |
<label class="field" for="maskbit"> | |
<span class="label__description">このビットでマスクします</span> | |
<input type="text" name="" readonly id="maskbit"> | |
</label> | |
<label class="field" for="masked"> | |
<span class="label__description">暗号化した結果</span> | |
<input type="text" name="" readonly id="masked"> | |
</label> | |
<label class="field" for="unmasked"> | |
<span class="label__description">復号化した結果</span> | |
<input type="text" name="" readonly id="unmaskedbit"> | |
<input type="text" name="" readonly id="unmasked"> | |
</label> | |
</div> | |
<!-- SCRIPTS --> | |
<script type="text/javascript" charset="UTF-8" src="./main.js"> | |
</script> | |
</body> | |
</html> |
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
(function (console) { "use strict"; | |
var $estr = function() { return js_Boot.__string_rec(this,''); }; | |
function $extend(from, fields) { | |
function Inherit() {} Inherit.prototype = from; var proto = new Inherit(); | |
for (var name in fields) proto[name] = fields[name]; | |
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; | |
return proto; | |
} | |
var HxOverrides = function() { }; | |
HxOverrides.__name__ = true; | |
HxOverrides.cca = function(s,index) { | |
var x = s.charCodeAt(index); | |
if(x != x) return undefined; | |
return x; | |
}; | |
var OneTimePad = function(words) { | |
this.words = haxe_io_Bytes.ofString(words); | |
var _len = this.words.length; | |
var _buf = haxe_io_Bytes.alloc(_len); | |
var _g = 0; | |
while(_g < _len) { | |
var i = _g++; | |
_buf.set(i,Std.random(128)); | |
} | |
this.mask = _buf; | |
}; | |
OneTimePad.__name__ = true; | |
OneTimePad._mask = function(val,mask) { | |
var len = val.length; | |
var buf = haxe_io_Bytes.alloc(len); | |
var _g = 0; | |
while(_g < len) { | |
var i = _g++; | |
buf.b[i] = (val.b[i] ^ mask.b[i]) & 255; | |
} | |
return buf; | |
}; | |
OneTimePad.prototype = { | |
encrypt: function() { | |
if(this._enctypted != null) return this._enctypted; | |
var enc = OneTimePad._mask(this.words,this.mask); | |
this._enctypted = enc; | |
return enc; | |
} | |
,decrypt: function() { | |
var dec = OneTimePad._mask(this._enctypted,this.mask); | |
return dec; | |
} | |
,__class__: OneTimePad | |
}; | |
var Main = function() { }; | |
Main.__name__ = true; | |
Main.main = function() { | |
var binWordsField = window.document.querySelector("#bin-words"); | |
var maskField = window.document.querySelector("#maskbit"); | |
var maskedField = window.document.querySelector("#masked"); | |
var unmaskedBitField = window.document.querySelector("#unmaskedbit"); | |
var unmaskedField = window.document.querySelector("#unmasked"); | |
window.document.querySelector("#words").addEventListener("change",function(ev) { | |
var value = ev.target.value; | |
if(value == "" || value == null) return; | |
var pad = new OneTimePad(value); | |
binWordsField.value = parseInt(pad.words.toHex(),16).toString(2); | |
maskField.value = parseInt(pad.mask.toHex(),16).toString(2); | |
maskedField.value = parseInt(pad.encrypt().toHex(),16).toString(2); | |
var dec = pad.decrypt(); | |
unmaskedBitField.value = parseInt(dec.toHex(),16).toString(2); | |
unmaskedField.value = dec.toString(); | |
}); | |
}; | |
Math.__name__ = true; | |
var Std = function() { }; | |
Std.__name__ = true; | |
Std.string = function(s) { | |
return js_Boot.__string_rec(s,""); | |
}; | |
Std.random = function(x) { | |
if(x <= 0) return 0; else return Math.floor(Math.random() * x); | |
}; | |
var StringTools = function() { }; | |
StringTools.__name__ = true; | |
StringTools.fastCodeAt = function(s,index) { | |
return s.charCodeAt(index); | |
}; | |
var haxe__$Int64__$_$_$Int64 = function(high,low) { | |
this.high = high; | |
this.low = low; | |
}; | |
haxe__$Int64__$_$_$Int64.__name__ = true; | |
haxe__$Int64__$_$_$Int64.prototype = { | |
__class__: haxe__$Int64__$_$_$Int64 | |
}; | |
var haxe_io_Bytes = function(data) { | |
this.length = data.byteLength; | |
this.b = new Uint8Array(data); | |
this.b.bufferValue = data; | |
data.hxBytes = this; | |
data.bytes = this.b; | |
}; | |
haxe_io_Bytes.__name__ = true; | |
haxe_io_Bytes.alloc = function(length) { | |
return new haxe_io_Bytes(new ArrayBuffer(length)); | |
}; | |
haxe_io_Bytes.ofString = function(s) { | |
var a = []; | |
var i = 0; | |
while(i < s.length) { | |
var c = StringTools.fastCodeAt(s,i++); | |
if(55296 <= c && c <= 56319) c = c - 55232 << 10 | StringTools.fastCodeAt(s,i++) & 1023; | |
if(c <= 127) a.push(c); else if(c <= 2047) { | |
a.push(192 | c >> 6); | |
a.push(128 | c & 63); | |
} else if(c <= 65535) { | |
a.push(224 | c >> 12); | |
a.push(128 | c >> 6 & 63); | |
a.push(128 | c & 63); | |
} else { | |
a.push(240 | c >> 18); | |
a.push(128 | c >> 12 & 63); | |
a.push(128 | c >> 6 & 63); | |
a.push(128 | c & 63); | |
} | |
} | |
return new haxe_io_Bytes(new Uint8Array(a).buffer); | |
}; | |
haxe_io_Bytes.prototype = { | |
set: function(pos,v) { | |
this.b[pos] = v & 255; | |
} | |
,getString: function(pos,len) { | |
if(pos < 0 || len < 0 || pos + len > this.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds); | |
var s = ""; | |
var b = this.b; | |
var fcc = String.fromCharCode; | |
var i = pos; | |
var max = pos + len; | |
while(i < max) { | |
var c = b[i++]; | |
if(c < 128) { | |
if(c == 0) break; | |
s += fcc(c); | |
} else if(c < 224) s += fcc((c & 63) << 6 | b[i++] & 127); else if(c < 240) { | |
var c2 = b[i++]; | |
s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127); | |
} else { | |
var c21 = b[i++]; | |
var c3 = b[i++]; | |
var u = (c & 15) << 18 | (c21 & 127) << 12 | (c3 & 127) << 6 | b[i++] & 127; | |
s += fcc((u >> 10) + 55232); | |
s += fcc(u & 1023 | 56320); | |
} | |
} | |
return s; | |
} | |
,toString: function() { | |
return this.getString(0,this.length); | |
} | |
,toHex: function() { | |
var s_b = ""; | |
var chars = []; | |
var str = "0123456789abcdef"; | |
var _g1 = 0; | |
var _g = str.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
chars.push(HxOverrides.cca(str,i)); | |
} | |
var _g11 = 0; | |
var _g2 = this.length; | |
while(_g11 < _g2) { | |
var i1 = _g11++; | |
var c = this.b[i1]; | |
s_b += String.fromCharCode(chars[c >> 4]); | |
s_b += String.fromCharCode(chars[c & 15]); | |
} | |
return s_b; | |
} | |
,__class__: haxe_io_Bytes | |
}; | |
var haxe_io_Error = { __ename__ : true, __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] }; | |
haxe_io_Error.Blocked = ["Blocked",0]; | |
haxe_io_Error.Blocked.toString = $estr; | |
haxe_io_Error.Blocked.__enum__ = haxe_io_Error; | |
haxe_io_Error.Overflow = ["Overflow",1]; | |
haxe_io_Error.Overflow.toString = $estr; | |
haxe_io_Error.Overflow.__enum__ = haxe_io_Error; | |
haxe_io_Error.OutsideBounds = ["OutsideBounds",2]; | |
haxe_io_Error.OutsideBounds.toString = $estr; | |
haxe_io_Error.OutsideBounds.__enum__ = haxe_io_Error; | |
haxe_io_Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe_io_Error; $x.toString = $estr; return $x; }; | |
var haxe_io_FPHelper = function() { }; | |
haxe_io_FPHelper.__name__ = true; | |
haxe_io_FPHelper.i32ToFloat = function(i) { | |
var sign = 1 - (i >>> 31 << 1); | |
var exp = i >>> 23 & 255; | |
var sig = i & 8388607; | |
if(sig == 0 && exp == 0) return 0.0; | |
return sign * (1 + Math.pow(2,-23) * sig) * Math.pow(2,exp - 127); | |
}; | |
haxe_io_FPHelper.floatToI32 = function(f) { | |
if(f == 0) return 0; | |
var af; | |
if(f < 0) af = -f; else af = f; | |
var exp = Math.floor(Math.log(af) / 0.6931471805599453); | |
if(exp < -127) exp = -127; else if(exp > 128) exp = 128; | |
var sig = Math.round((af / Math.pow(2,exp) - 1) * 8388608) & 8388607; | |
return (f < 0?-2147483648:0) | exp + 127 << 23 | sig; | |
}; | |
haxe_io_FPHelper.i64ToDouble = function(low,high) { | |
var sign = 1 - (high >>> 31 << 1); | |
var exp = (high >> 20 & 2047) - 1023; | |
var sig = (high & 1048575) * 4294967296. + (low >>> 31) * 2147483648. + (low & 2147483647); | |
if(sig == 0 && exp == -1023) return 0.0; | |
return sign * (1.0 + Math.pow(2,-52) * sig) * Math.pow(2,exp); | |
}; | |
haxe_io_FPHelper.doubleToI64 = function(v) { | |
var i64 = haxe_io_FPHelper.i64tmp; | |
if(v == 0) { | |
i64.low = 0; | |
i64.high = 0; | |
} else { | |
var av; | |
if(v < 0) av = -v; else av = v; | |
var exp = Math.floor(Math.log(av) / 0.6931471805599453); | |
var sig; | |
var v1 = (av / Math.pow(2,exp) - 1) * 4503599627370496.; | |
sig = Math.round(v1); | |
var sig_l = sig | 0; | |
var sig_h = sig / 4294967296.0 | 0; | |
i64.low = sig_l; | |
i64.high = (v < 0?-2147483648:0) | exp + 1023 << 20 | sig_h; | |
} | |
return i64; | |
}; | |
var js__$Boot_HaxeError = function(val) { | |
Error.call(this); | |
this.val = val; | |
this.message = String(val); | |
if(Error.captureStackTrace) Error.captureStackTrace(this,js__$Boot_HaxeError); | |
}; | |
js__$Boot_HaxeError.__name__ = true; | |
js__$Boot_HaxeError.__super__ = Error; | |
js__$Boot_HaxeError.prototype = $extend(Error.prototype,{ | |
__class__: js__$Boot_HaxeError | |
}); | |
var js_Boot = function() { }; | |
js_Boot.__name__ = true; | |
js_Boot.getClass = function(o) { | |
if((o instanceof Array) && o.__enum__ == null) return Array; else { | |
var cl = o.__class__; | |
if(cl != null) return cl; | |
var name = js_Boot.__nativeClassName(o); | |
if(name != null) return js_Boot.__resolveNativeClass(name); | |
return null; | |
} | |
}; | |
js_Boot.__string_rec = function(o,s) { | |
if(o == null) return "null"; | |
if(s.length >= 5) return "<...>"; | |
var t = typeof(o); | |
if(t == "function" && (o.__name__ || o.__ename__)) t = "object"; | |
switch(t) { | |
case "object": | |
if(o instanceof Array) { | |
if(o.__enum__) { | |
if(o.length == 2) return o[0]; | |
var str2 = o[0] + "("; | |
s += "\t"; | |
var _g1 = 2; | |
var _g = o.length; | |
while(_g1 < _g) { | |
var i1 = _g1++; | |
if(i1 != 2) str2 += "," + js_Boot.__string_rec(o[i1],s); else str2 += js_Boot.__string_rec(o[i1],s); | |
} | |
return str2 + ")"; | |
} | |
var l = o.length; | |
var i; | |
var str1 = "["; | |
s += "\t"; | |
var _g2 = 0; | |
while(_g2 < l) { | |
var i2 = _g2++; | |
str1 += (i2 > 0?",":"") + js_Boot.__string_rec(o[i2],s); | |
} | |
str1 += "]"; | |
return str1; | |
} | |
var tostr; | |
try { | |
tostr = o.toString; | |
} catch( e ) { | |
if (e instanceof js__$Boot_HaxeError) e = e.val; | |
return "???"; | |
} | |
if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { | |
var s2 = o.toString(); | |
if(s2 != "[object Object]") return s2; | |
} | |
var k = null; | |
var str = "{\n"; | |
s += "\t"; | |
var hasp = o.hasOwnProperty != null; | |
for( var k in o ) { | |
if(hasp && !o.hasOwnProperty(k)) { | |
continue; | |
} | |
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { | |
continue; | |
} | |
if(str.length != 2) str += ", \n"; | |
str += s + k + " : " + js_Boot.__string_rec(o[k],s); | |
} | |
s = s.substring(1); | |
str += "\n" + s + "}"; | |
return str; | |
case "function": | |
return "<function>"; | |
case "string": | |
return o; | |
default: | |
return String(o); | |
} | |
}; | |
js_Boot.__interfLoop = function(cc,cl) { | |
if(cc == null) return false; | |
if(cc == cl) return true; | |
var intf = cc.__interfaces__; | |
if(intf != null) { | |
var _g1 = 0; | |
var _g = intf.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
var i1 = intf[i]; | |
if(i1 == cl || js_Boot.__interfLoop(i1,cl)) return true; | |
} | |
} | |
return js_Boot.__interfLoop(cc.__super__,cl); | |
}; | |
js_Boot.__instanceof = function(o,cl) { | |
if(cl == null) return false; | |
switch(cl) { | |
case Int: | |
return (o|0) === o; | |
case Float: | |
return typeof(o) == "number"; | |
case Bool: | |
return typeof(o) == "boolean"; | |
case String: | |
return typeof(o) == "string"; | |
case Array: | |
return (o instanceof Array) && o.__enum__ == null; | |
case Dynamic: | |
return true; | |
default: | |
if(o != null) { | |
if(typeof(cl) == "function") { | |
if(o instanceof cl) return true; | |
if(js_Boot.__interfLoop(js_Boot.getClass(o),cl)) return true; | |
} else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) { | |
if(o instanceof cl) return true; | |
} | |
} else return false; | |
if(cl == Class && o.__name__ != null) return true; | |
if(cl == Enum && o.__ename__ != null) return true; | |
return o.__enum__ == cl; | |
} | |
}; | |
js_Boot.__nativeClassName = function(o) { | |
var name = js_Boot.__toStr.call(o).slice(8,-1); | |
if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") return null; | |
return name; | |
}; | |
js_Boot.__isNativeObj = function(o) { | |
return js_Boot.__nativeClassName(o) != null; | |
}; | |
js_Boot.__resolveNativeClass = function(name) { | |
return (Function("return typeof " + name + " != \"undefined\" ? " + name + " : null"))(); | |
}; | |
var js_html_compat_ArrayBuffer = function(a) { | |
if((a instanceof Array) && a.__enum__ == null) { | |
this.a = a; | |
this.byteLength = a.length; | |
} else { | |
var len = a; | |
this.a = []; | |
var _g = 0; | |
while(_g < len) { | |
var i = _g++; | |
this.a[i] = 0; | |
} | |
this.byteLength = len; | |
} | |
}; | |
js_html_compat_ArrayBuffer.__name__ = true; | |
js_html_compat_ArrayBuffer.sliceImpl = function(begin,end) { | |
var u = new Uint8Array(this,begin,end == null?null:end - begin); | |
var result = new ArrayBuffer(u.byteLength); | |
var resultArray = new Uint8Array(result); | |
resultArray.set(u); | |
return result; | |
}; | |
js_html_compat_ArrayBuffer.prototype = { | |
slice: function(begin,end) { | |
return new js_html_compat_ArrayBuffer(this.a.slice(begin,end)); | |
} | |
,__class__: js_html_compat_ArrayBuffer | |
}; | |
var js_html_compat_DataView = function(buffer,byteOffset,byteLength) { | |
this.buf = buffer; | |
if(byteOffset == null) this.offset = 0; else this.offset = byteOffset; | |
if(byteLength == null) this.length = buffer.byteLength - this.offset; else this.length = byteLength; | |
if(this.offset < 0 || this.length < 0 || this.offset + this.length > buffer.byteLength) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds); | |
}; | |
js_html_compat_DataView.__name__ = true; | |
js_html_compat_DataView.prototype = { | |
getInt8: function(byteOffset) { | |
var v = this.buf.a[this.offset + byteOffset]; | |
if(v >= 128) return v - 256; else return v; | |
} | |
,getUint8: function(byteOffset) { | |
return this.buf.a[this.offset + byteOffset]; | |
} | |
,getInt16: function(byteOffset,littleEndian) { | |
var v = this.getUint16(byteOffset,littleEndian); | |
if(v >= 32768) return v - 65536; else return v; | |
} | |
,getUint16: function(byteOffset,littleEndian) { | |
if(littleEndian) return this.buf.a[this.offset + byteOffset] | this.buf.a[this.offset + byteOffset + 1] << 8; else return this.buf.a[this.offset + byteOffset] << 8 | this.buf.a[this.offset + byteOffset + 1]; | |
} | |
,getInt32: function(byteOffset,littleEndian) { | |
var p = this.offset + byteOffset; | |
var a = this.buf.a[p++]; | |
var b = this.buf.a[p++]; | |
var c = this.buf.a[p++]; | |
var d = this.buf.a[p++]; | |
if(littleEndian) return a | b << 8 | c << 16 | d << 24; else return d | c << 8 | b << 16 | a << 24; | |
} | |
,getUint32: function(byteOffset,littleEndian) { | |
var v = this.getInt32(byteOffset,littleEndian); | |
if(v < 0) return v + 4294967296.; else return v; | |
} | |
,getFloat32: function(byteOffset,littleEndian) { | |
return haxe_io_FPHelper.i32ToFloat(this.getInt32(byteOffset,littleEndian)); | |
} | |
,getFloat64: function(byteOffset,littleEndian) { | |
var a = this.getInt32(byteOffset,littleEndian); | |
var b = this.getInt32(byteOffset + 4,littleEndian); | |
return haxe_io_FPHelper.i64ToDouble(littleEndian?a:b,littleEndian?b:a); | |
} | |
,setInt8: function(byteOffset,value) { | |
if(value < 0) this.buf.a[byteOffset + this.offset] = value + 128 & 255; else this.buf.a[byteOffset + this.offset] = value & 255; | |
} | |
,setUint8: function(byteOffset,value) { | |
this.buf.a[byteOffset + this.offset] = value & 255; | |
} | |
,setInt16: function(byteOffset,value,littleEndian) { | |
this.setUint16(byteOffset,value < 0?value + 65536:value,littleEndian); | |
} | |
,setUint16: function(byteOffset,value,littleEndian) { | |
var p = byteOffset + this.offset; | |
if(littleEndian) { | |
this.buf.a[p] = value & 255; | |
this.buf.a[p++] = value >> 8 & 255; | |
} else { | |
this.buf.a[p++] = value >> 8 & 255; | |
this.buf.a[p] = value & 255; | |
} | |
} | |
,setInt32: function(byteOffset,value,littleEndian) { | |
this.setUint32(byteOffset,value,littleEndian); | |
} | |
,setUint32: function(byteOffset,value,littleEndian) { | |
var p = byteOffset + this.offset; | |
if(littleEndian) { | |
this.buf.a[p++] = value & 255; | |
this.buf.a[p++] = value >> 8 & 255; | |
this.buf.a[p++] = value >> 16 & 255; | |
this.buf.a[p++] = value >>> 24; | |
} else { | |
this.buf.a[p++] = value >>> 24; | |
this.buf.a[p++] = value >> 16 & 255; | |
this.buf.a[p++] = value >> 8 & 255; | |
this.buf.a[p++] = value & 255; | |
} | |
} | |
,setFloat32: function(byteOffset,value,littleEndian) { | |
this.setUint32(byteOffset,haxe_io_FPHelper.floatToI32(value),littleEndian); | |
} | |
,setFloat64: function(byteOffset,value,littleEndian) { | |
var i64 = haxe_io_FPHelper.doubleToI64(value); | |
if(littleEndian) { | |
this.setUint32(byteOffset,i64.low); | |
this.setUint32(byteOffset,i64.high); | |
} else { | |
this.setUint32(byteOffset,i64.high); | |
this.setUint32(byteOffset,i64.low); | |
} | |
} | |
,__class__: js_html_compat_DataView | |
}; | |
var js_html_compat_Uint8Array = function() { }; | |
js_html_compat_Uint8Array.__name__ = true; | |
js_html_compat_Uint8Array._new = function(arg1,offset,length) { | |
var arr; | |
if(typeof(arg1) == "number") { | |
arr = []; | |
var _g = 0; | |
while(_g < arg1) { | |
var i = _g++; | |
arr[i] = 0; | |
} | |
arr.byteLength = arr.length; | |
arr.byteOffset = 0; | |
arr.buffer = new js_html_compat_ArrayBuffer(arr); | |
} else if(js_Boot.__instanceof(arg1,js_html_compat_ArrayBuffer)) { | |
var buffer = arg1; | |
if(offset == null) offset = 0; | |
if(length == null) length = buffer.byteLength - offset; | |
if(offset == 0) arr = buffer.a; else arr = buffer.a.slice(offset,offset + length); | |
arr.byteLength = arr.length; | |
arr.byteOffset = offset; | |
arr.buffer = buffer; | |
} else if((arg1 instanceof Array) && arg1.__enum__ == null) { | |
arr = arg1.slice(); | |
arr.byteLength = arr.length; | |
arr.byteOffset = 0; | |
arr.buffer = new js_html_compat_ArrayBuffer(arr); | |
} else throw new js__$Boot_HaxeError("TODO " + Std.string(arg1)); | |
arr.subarray = js_html_compat_Uint8Array._subarray; | |
arr.set = js_html_compat_Uint8Array._set; | |
return arr; | |
}; | |
js_html_compat_Uint8Array._set = function(arg,offset) { | |
var t = this; | |
if(js_Boot.__instanceof(arg.buffer,js_html_compat_ArrayBuffer)) { | |
var a = arg; | |
if(arg.byteLength + offset > t.byteLength) throw new js__$Boot_HaxeError("set() outside of range"); | |
var _g1 = 0; | |
var _g = arg.byteLength; | |
while(_g1 < _g) { | |
var i = _g1++; | |
t[i + offset] = a[i]; | |
} | |
} else if((arg instanceof Array) && arg.__enum__ == null) { | |
var a1 = arg; | |
if(a1.length + offset > t.byteLength) throw new js__$Boot_HaxeError("set() outside of range"); | |
var _g11 = 0; | |
var _g2 = a1.length; | |
while(_g11 < _g2) { | |
var i1 = _g11++; | |
t[i1 + offset] = a1[i1]; | |
} | |
} else throw new js__$Boot_HaxeError("TODO"); | |
}; | |
js_html_compat_Uint8Array._subarray = function(start,end) { | |
var t = this; | |
var a = js_html_compat_Uint8Array._new(t.slice(start,end)); | |
a.byteOffset = start; | |
return a; | |
}; | |
String.prototype.__class__ = String; | |
String.__name__ = true; | |
Array.__name__ = true; | |
var Int = { __name__ : ["Int"]}; | |
var Dynamic = { __name__ : ["Dynamic"]}; | |
var Float = Number; | |
Float.__name__ = ["Float"]; | |
var Bool = Boolean; | |
Bool.__ename__ = ["Bool"]; | |
var Class = { __name__ : ["Class"]}; | |
var Enum = { }; | |
var ArrayBuffer = (Function("return typeof ArrayBuffer != 'undefined' ? ArrayBuffer : null"))() || js_html_compat_ArrayBuffer; | |
if(ArrayBuffer.prototype.slice == null) ArrayBuffer.prototype.slice = js_html_compat_ArrayBuffer.sliceImpl; | |
var DataView = (Function("return typeof DataView != 'undefined' ? DataView : null"))() || js_html_compat_DataView; | |
var Uint8Array = (Function("return typeof Uint8Array != 'undefined' ? Uint8Array : null"))() || js_html_compat_Uint8Array._new; | |
haxe_io_FPHelper.i64tmp = (function($this) { | |
var $r; | |
var x = new haxe__$Int64__$_$_$Int64(0,0); | |
$r = x; | |
return $r; | |
}(this)); | |
js_Boot.__toStr = {}.toString; | |
js_html_compat_Uint8Array.BYTES_PER_ELEMENT = 1; | |
Main.main(); | |
})(typeof console != "undefined" ? console : {log:function(){}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment