1413 lines
58 KiB
HTML
1413 lines
58 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>WebOas.is - Torrent Creator</title>
|
|
<meta name="description" content="Create torrent files directly in your web browser.">
|
|
<meta name="keywords" content="torrent,torrent file">
|
|
<link rel="icon" href="favicon.png">
|
|
<style>
|
|
body
|
|
{
|
|
background: #323639;
|
|
color: white;
|
|
font-family: Sans-Serif;
|
|
}
|
|
button
|
|
{
|
|
background-color: #146dff;
|
|
border: none;
|
|
border-radius: 5px;
|
|
color: #ffffff;
|
|
padding: 10px 15px 10px 15px; /*top right bottom left*/
|
|
margin: 5px 0px 5px 20px;
|
|
font-family: "Verdana";
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
transition: 0.15s;
|
|
outline: none;
|
|
}
|
|
button:hover
|
|
{
|
|
background-color: #54adff;
|
|
cursor: pointer;
|
|
}
|
|
button:disabled
|
|
{
|
|
background-color: #77abff;
|
|
cursor: not-allowed;
|
|
}
|
|
textarea
|
|
{
|
|
font-size: 22px;
|
|
margin: 20px;
|
|
padding: 10px;
|
|
resize: none;
|
|
white-space: nowrap;
|
|
font-family: Sans-Serif;
|
|
}
|
|
a
|
|
{
|
|
color: #00e0ff;
|
|
}
|
|
select
|
|
{
|
|
font-size: 22px;
|
|
padding: 2px;
|
|
border-radius: 4px;
|
|
}
|
|
.progress-bar-visible
|
|
{
|
|
visibility: visible;
|
|
opacity: 1;
|
|
height: 40px;
|
|
transition: opacity 0.3s linear, height 0.3s ease-in-out;
|
|
}
|
|
.progress-bar-hidden
|
|
{
|
|
visibility: hidden;
|
|
opacity: 0;
|
|
height: 0px;
|
|
transition: visibility 0s 0.3s, opacity 0.3s linear, height 0.2s ease-in-out;
|
|
}
|
|
label
|
|
{
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<button style="width: 200px" onclick="document.getElementById('filechooser').click()">Select File</button>
|
|
<button style="width: 200px" id="folderchooserbutton" onclick="document.getElementById('folderchooser').click()">Select Folder</button>
|
|
<div id="selected_file_info" style="display: inline; font-size: 22px; margin-left: 30px;"></div>
|
|
<br />
|
|
<input type="file" style="display: none" id="filechooser" onclick="this.value=null" onchange="FileSelected(this.files)">
|
|
<input type="file" style="display: none" id="folderchooser" webkitdirectory onclick="this.value=null" onchange="FolderSelected(this.files)">
|
|
<div id="no_folder_warning" style="display: none; margin: 20px; color: #ff3d58; font-size: 20px;">Your browser does not support folder selection, so you can only create torrent files from single files. You can check which browsers support folder selection <a href="https://caniuse.com/#feat=input-file-directory">here.</a> <a href="javascript:void(0)" onclick="document.getElementById('no_folder_warning').style.display='none'">(hide warning)</a></div>
|
|
<div id="no_wasm_warning" style="display: none; margin-left: 20px; color: #ff3d58; font-size: 20px;">Warning: your browser does not support webassembly. It will take a long time to read large files. You can check which browsers support webassembly <a href="https://caniuse.com/#feat=wasm">here.</a> <a href="javascript:void(0)" onclick="document.getElementById('no_wasm_warning').style.display='none'">(hide warning)</a></div>
|
|
<input type="text" id="torrent_name" style="width: calc(100% - 60px); font-size: 22px; padding: 5px; margin: 20px;" placeholder="Torrent Name"></input>
|
|
<br />
|
|
<div style="display: flex; flex-wrap: wrap;">
|
|
<label style="display: inline; margin-left: 30px; font-size: 22px; border-right: 100px solid transparent;">Piece Size:
|
|
<select id="torrent_block_size" style="width: 200px; margin-left: 20px; margin-bottom: 20px; display: inline; flex-width: 200px;">
|
|
<option value="0">Automatic</option>
|
|
<option value="16384">16 kB</option>
|
|
<option value="32768">32 kB</option>
|
|
<option value="65536">64 kB</option>
|
|
<option value="131072">128 kB</option>
|
|
<option value="262144">256 kB</option>
|
|
<option value="524288">512 kB</option>
|
|
<option value="1048576">1 MB</option>
|
|
<option value="2097152">2 MB</option>
|
|
<option value="4194304">4 MB</option>
|
|
<option value="8388608">8 MB</option>
|
|
<option value="16777216">16 MB</option>
|
|
</select>
|
|
</label>
|
|
<label style="display: inline; font-size: 22px; margin-left: 30px; margin-bottom: 20px;">Private Torrent<input id="torrent_is_private" type="checkbox" style="transform:scale(2); background: white; margin-left: 20px;"></label>
|
|
</div>
|
|
<label style="font-size: 22px; margin-left: 30px;">Set Creation Date<input id="torrent_creation_date" type="checkbox" style="transform:scale(2); background: white; margin-left: 20px;" checked></label>
|
|
<br />
|
|
<textarea id="torrent_trackers" style="width: calc(100% - 68px); height: 150px; margin-top: 20px;" placeholder="Trackers, one per line (optional)"></textarea>
|
|
<br />
|
|
<input type="text" id="torrent_comment" style="width: calc(100% - 60px); font-size: 22px; padding: 5px; margin-left: 20px; margin-bottom: 20px;" placeholder="Comment (optional)"></input>
|
|
<br />
|
|
<input type="text" id="torrent_source" style="width: calc(100% - 60px); font-size: 22px; padding: 5px; margin-left: 20px; margin-bottom: 20px;" placeholder="Source (optional)"></input>
|
|
<br />
|
|
<div id="error_text" style="display: none; font-size: 25px; color: #ff3d58; margin-left: 20px; margin-bottom: 20px;"></div>
|
|
<div id="progressbar_container" class="progress-bar-hidden" style="margin-left: 20px; border: 2px solid #bcbcbc; border-radius: 5px; width: calc(100% - 50px); position: relative;">
|
|
<div id="progressbar" style="background: #23b235; width: 0%; height: 100%; border-radius: 3px;"></div>
|
|
<div id="progressbar_text" style="display:block; position: absolute; bottom: 4px; font-size: 25px; padding-bottom: 2px; padding-left: 6px; text-shadow: 2px 2px 5px blue;"></div>
|
|
</div>
|
|
<button id="create_torrent_button" style="display: grid; margin-top: 20px; width: calc(100% - 46px); max-width: 600px; height: 100px; font-size: 50px;" onclick="CreateTorrent()" disabled>Create Torrent</button>
|
|
<script>
|
|
if (document.getElementById("folderchooser").webkitdirectory === undefined)
|
|
{
|
|
document.getElementById("no_folder_warning").style.display = "block";
|
|
document.getElementById("folderchooserbutton").disabled = true;
|
|
}
|
|
var sha1func;
|
|
function GetSizeStr(size)
|
|
{
|
|
if (size < 1024)
|
|
return size + " bytes";
|
|
|
|
if (size < 1048576)
|
|
return ((size / 1024) | 0) + " kB";
|
|
|
|
if (size < 1073741824)
|
|
return ((size / 1048576) | 0) + " MB";
|
|
|
|
return (size / 1073741824).toFixed(2) + " GB";
|
|
}
|
|
var allFiles;
|
|
var singleFile;
|
|
var totalSize;
|
|
function FolderSelected(files)
|
|
{
|
|
var folderName = files[0].webkitRelativePath.split("/")[0];
|
|
document.getElementById("torrent_name").value = folderName;
|
|
|
|
allFiles = [];
|
|
totalSize = 0;
|
|
for (var i = 0; i < files.length; ++i)
|
|
{
|
|
allFiles.push(files[i]);
|
|
totalSize += files[i].size;
|
|
}
|
|
|
|
document.getElementById("selected_file_info").innerHTML = "Selected folder: " + folderName + " (" + GetSizeStr(totalSize) + ")";
|
|
singleFile = undefined;
|
|
document.getElementById("create_torrent_button").disabled = false;
|
|
}
|
|
function FileSelected(files)
|
|
{
|
|
singleFile = files[0];
|
|
var fileName = singleFile.name;
|
|
totalSize = singleFile.size;
|
|
document.getElementById("torrent_name").value = fileName;
|
|
document.getElementById("selected_file_info").innerHTML = "Selected file: " + fileName + " (" + GetSizeStr(totalSize) + ")";
|
|
allFiles = undefined;
|
|
document.getElementById("create_torrent_button").disabled = false;
|
|
}
|
|
var creationInProgress = false;
|
|
var blockSize = 262144;
|
|
function CreateTorrent()
|
|
{
|
|
var errorTextDiv = document.getElementById("error_text");
|
|
if (creationInProgress)
|
|
{
|
|
Finalize();
|
|
return;
|
|
}
|
|
|
|
var torrentName = document.getElementById("torrent_name").value.trim();
|
|
if (torrentName == "")
|
|
{
|
|
errorTextDiv.innerHTML = "Torrent name must not be empty";
|
|
errorTextDiv.style.display = "block";
|
|
return;
|
|
}
|
|
|
|
if (torrentName.match(/[<>:\"\\\/\|\?\*]/))
|
|
{
|
|
errorTextDiv.innerHTML = "Torrent name cannot contain any of the following characters: < > : \\ / | ? *";
|
|
errorTextDiv.style.display = "block";
|
|
return;
|
|
}
|
|
|
|
if (torrentName.length > 255)
|
|
{
|
|
errorTextDiv.innerHTML = "Torrent name cannot be longer than 255 characters";
|
|
errorTextDiv.style.display = "block";
|
|
return;
|
|
}
|
|
|
|
|
|
var torrentObject = {};
|
|
var trackers = document.getElementById("torrent_trackers").value.split("\n");
|
|
var okTrackers = [];
|
|
for (var i = 0; i < trackers.length; ++i)
|
|
{
|
|
var current = trackers[i].trim();
|
|
if (current == "")
|
|
continue;
|
|
|
|
if (current.match(/.+:\/\/([a-z0-9-]+\.)*([a-z0-9-]+):\d+((\/.*)\/announce)?/))
|
|
okTrackers.push(current);
|
|
else
|
|
{
|
|
errorTextDiv.innerHTML = "Invalid tracker: " + current;
|
|
errorTextDiv.style.display = "block";
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (okTrackers.length != 0)
|
|
{
|
|
torrentObject["announce"] = trackers[0];
|
|
var announceList = [];
|
|
for (var i = 0; i < trackers.length; ++i)
|
|
announceList.push([trackers[i]]);
|
|
|
|
torrentObject["announce-list"] = announceList;
|
|
}
|
|
|
|
var comment = document.getElementById("torrent_comment").value;
|
|
if (comment != "")
|
|
torrentObject["comment"] = comment;
|
|
|
|
if (document.getElementById("torrent_creation_date").checked)
|
|
torrentObject["creation date"] = (Date.now() / 1000) | 0;
|
|
|
|
torrentObject["created by"] = "kimbatt.github.io/torrent-creator";
|
|
|
|
var infoObject = {};
|
|
if (document.getElementById("torrent_is_private").checked)
|
|
infoObject["private"] = 1;
|
|
|
|
infoObject["name"] = torrentName;
|
|
var blockSizeComboBox = document.getElementById("torrent_block_size");
|
|
blockSize = +blockSizeComboBox.options[blockSizeComboBox.selectedIndex].value;
|
|
if (blockSize == 0)
|
|
{
|
|
var factor = Math.round(Math.log2(totalSize / 1200));
|
|
|
|
if (factor < 14)
|
|
factor = 14;
|
|
else if (factor > 24)
|
|
factor = 24;
|
|
|
|
blockSize = 1 << factor;
|
|
}
|
|
|
|
infoObject["piece length"] = blockSize;
|
|
|
|
var source = document.getElementById("torrent_source").value;
|
|
if (source != "")
|
|
infoObject["source"] = source;
|
|
|
|
torrentObject["info"] = infoObject;
|
|
|
|
creationInProgress = true;
|
|
document.getElementById("progressbar_container").className = "progress-bar-visible";
|
|
document.getElementById("create_torrent_button").innerHTML = "Cancel";
|
|
|
|
errorTextDiv.style.display = "none";
|
|
DisableElements(true);
|
|
|
|
if (singleFile !== undefined)
|
|
CreateFromFile(torrentObject);
|
|
else if (allFiles !== undefined)
|
|
CreateFromFolder(torrentObject);
|
|
}
|
|
|
|
function Finished(obj)
|
|
{
|
|
var pieceBytes = obj.info["pieces"];
|
|
var pieceStr = "";
|
|
for (var i = 0; i < pieceBytes.length; ++i)
|
|
pieceStr += String.fromCharCode(pieceBytes[i]);
|
|
|
|
obj.info["pieces"] = pieceStr;
|
|
|
|
var a = document.getElementById("download_link");
|
|
a.download = obj.info.name + ".torrent";
|
|
var url = window.URL.createObjectURL(new Blob([new Uint8Array(Bencode.EncodeToBytes(obj))], { type: "application/octet-stream" }));
|
|
a.href = url;
|
|
a.click();
|
|
a.onclick = function()
|
|
{
|
|
window.URL.revokeObjectURL(url);
|
|
a.onclick = null;
|
|
};
|
|
|
|
Finalize();
|
|
}
|
|
|
|
function Failed(filename)
|
|
{
|
|
var errorTextDiv = document.getElementById("error_text");
|
|
errorTextDiv.innerHTML = filename ? ("Failed to read file: " + filename.name) : "Error reading file";
|
|
errorTextDiv.style.display = "block";
|
|
document.getElementById("progressbar").style.display = "none";
|
|
document.getElementById("progressbar").style.width = "0%";
|
|
|
|
Finalize();
|
|
}
|
|
|
|
function Finalize()
|
|
{
|
|
creationInProgress = false;
|
|
document.getElementById("create_torrent_button").innerHTML = "Create torrent";
|
|
document.getElementById("progressbar_container").className = "progress-bar-hidden";
|
|
document.getElementById("progressbar_text").innerHTML = "";
|
|
document.getElementById("progressbar").style.width = "0%";
|
|
DisableElements(false);
|
|
}
|
|
|
|
function DisableElements(disable)
|
|
{
|
|
document.getElementById("torrent_name").disabled = disable;
|
|
document.getElementById("torrent_block_size").disabled = disable;
|
|
document.getElementById("torrent_is_private").disabled = disable;
|
|
document.getElementById("torrent_creation_date").disabled = disable;
|
|
document.getElementById("torrent_trackers").disabled = disable;
|
|
document.getElementById("torrent_comment").disabled = disable;
|
|
document.getElementById("torrent_source").disabled = disable;
|
|
}
|
|
|
|
function CreateFromFile(obj)
|
|
{
|
|
var progressBar = document.getElementById("progressbar").style;
|
|
var reader = new FileReader();
|
|
var chunkSize = obj.info["piece length"];
|
|
var file = singleFile;
|
|
var fileSize = file.size;
|
|
const readChunkSize = 16777216;
|
|
var pieces = [];
|
|
obj.info["length"] = fileSize;
|
|
var bytesReadSoFar = 0;
|
|
var readStartIndex = 0;
|
|
|
|
document.getElementById("progressbar_text").innerHTML = "Reading file: " + file.name;
|
|
|
|
var fr = new FileReader();
|
|
|
|
var loaded = function(e)
|
|
{
|
|
var result = new Uint8Array(e.target.result);
|
|
var count = Math.ceil(result.length / chunkSize);
|
|
|
|
for (var i = 0; i < count; ++i)
|
|
{
|
|
var sha = sha1func(result.slice(i * chunkSize, (i + 1) * chunkSize));
|
|
pieces.push.apply(pieces, sha);
|
|
}
|
|
|
|
bytesReadSoFar += result.length;
|
|
|
|
var progress = bytesReadSoFar / fileSize * 100;
|
|
progressBar.width = progress + "%";
|
|
|
|
if (bytesReadSoFar < fileSize)
|
|
reader();
|
|
else
|
|
{
|
|
obj.info["pieces"] = pieces;
|
|
Finished(obj);
|
|
}
|
|
}
|
|
|
|
var reader = function()
|
|
{
|
|
if (!creationInProgress)
|
|
return;
|
|
|
|
fr.readAsArrayBuffer(file.slice(readStartIndex, readStartIndex + readChunkSize));
|
|
readStartIndex += readChunkSize;
|
|
}
|
|
|
|
fr.onload = loaded;
|
|
fr.onerror = Failed;
|
|
|
|
reader();
|
|
}
|
|
|
|
function CreateFromFolder(obj)
|
|
{
|
|
if (allFiles.length == 0)
|
|
{
|
|
// valami
|
|
return;
|
|
}
|
|
|
|
var progressBar = document.getElementById("progressbar").style;
|
|
var reader = new FileReader();
|
|
var chunkSize = obj.info["piece length"];
|
|
var pieces = [];
|
|
var bytesReadSoFar = 0;
|
|
const readChunkSize = 16777216;
|
|
|
|
var totalSize = 0;
|
|
var fileInfos = [];
|
|
for (var i = 0; i < allFiles.length; ++i)
|
|
{
|
|
var currentFileInfo = allFiles[i];
|
|
var currentFileSize = currentFileInfo.size;
|
|
totalSize += currentFileSize;
|
|
fileInfos.push(
|
|
{
|
|
"length" : currentFileSize,
|
|
"path": currentFileInfo.webkitRelativePath.split("/").slice(1)
|
|
});
|
|
}
|
|
|
|
obj.info["files"] = fileInfos;
|
|
|
|
var fileIndex = 0;
|
|
var currentFile = allFiles[0];
|
|
|
|
var progressBarText = document.getElementById("progressbar_text");
|
|
|
|
var readStartIndex = 0;
|
|
var fileSize = currentFile.size;
|
|
var buffer = new Uint8Array(chunkSize);
|
|
var bufferIndex = 0;
|
|
|
|
var fr = new FileReader();
|
|
var loaded = function(e)
|
|
{
|
|
var result = new Uint8Array(e.target.result);
|
|
var startIndex = 0;
|
|
|
|
while (true)
|
|
{
|
|
var endIndex = startIndex + chunkSize - bufferIndex;
|
|
|
|
var sliced = result.slice(startIndex, endIndex);
|
|
if (sliced.length == 0)
|
|
break;
|
|
|
|
buffer.set(sliced, bufferIndex);
|
|
|
|
var readBytesCount = sliced.length;
|
|
if (readBytesCount + bufferIndex == chunkSize)
|
|
{
|
|
var sha = sha1func(buffer);
|
|
pieces.push.apply(pieces, sha);
|
|
|
|
bufferIndex = 0;
|
|
}
|
|
else
|
|
bufferIndex += readBytesCount;
|
|
|
|
startIndex = endIndex;
|
|
}
|
|
|
|
bytesReadSoFar += result.length;
|
|
readStartIndex += result.length;
|
|
|
|
var progress = bytesReadSoFar / totalSize * 100;
|
|
progressBar.width = progress + "%";
|
|
|
|
if (readStartIndex < fileSize)
|
|
reader();
|
|
else
|
|
{
|
|
++fileIndex;
|
|
|
|
if (fileIndex == allFiles.length)
|
|
{
|
|
var sha = sha1func(buffer.slice(0, bufferIndex));
|
|
pieces.push.apply(pieces, sha);
|
|
|
|
obj.info["pieces"] = pieces;
|
|
Finished(obj);
|
|
}
|
|
else
|
|
{
|
|
currentFile = allFiles[fileIndex];
|
|
fileSize = currentFile.size;
|
|
readStartIndex = 0;
|
|
progressBarText.innerHTML = "Reading file: " + currentFile.name;
|
|
reader();
|
|
}
|
|
}
|
|
}
|
|
|
|
var reader = function()
|
|
{
|
|
if (!creationInProgress)
|
|
return;
|
|
|
|
fr.readAsArrayBuffer(currentFile.slice(readStartIndex, readStartIndex + readChunkSize));
|
|
}
|
|
|
|
fr.onload = loaded;
|
|
fr.onerror = function()
|
|
{
|
|
Failed(currentFile);
|
|
};
|
|
|
|
reader();
|
|
}
|
|
|
|
</script>
|
|
|
|
<script>
|
|
// bencode
|
|
|
|
function toUTF8Array(str)
|
|
{
|
|
var utf8 = [];
|
|
for (var i = 0; i < str.length; ++i)
|
|
{
|
|
var charcode = str.charCodeAt(i);
|
|
if (charcode < 0x80)
|
|
utf8.push(charcode);
|
|
else if (charcode < 0x800)
|
|
utf8.push(0xc0 | (charcode >> 6), 0x80 | (charcode & 0x3f));
|
|
else if (charcode < 0xd800 || charcode >= 0xe000)
|
|
utf8.push(0xe0 | (charcode >> 12), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f));
|
|
else
|
|
{
|
|
++i;
|
|
charcode = 0x10000 + (((charcode & 0x3ff) << 10) | (str.charCodeAt(i) & 0x3ff));
|
|
utf8.push(0xf0 | (charcode >>18), 0x80 | ((charcode>>12) & 0x3f), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f));
|
|
}
|
|
}
|
|
|
|
return utf8;
|
|
}
|
|
|
|
function stringByteCount(str)
|
|
{
|
|
var count = 0;
|
|
for (var i = 0; i < str.length; ++i)
|
|
{
|
|
var charcode = str.charCodeAt(i);
|
|
if (charcode < 0x80)
|
|
++count;
|
|
else if (charcode < 0x800)
|
|
count += 2;
|
|
else if (charcode < 0xd800 || charcode >= 0xe000)
|
|
count += 3;
|
|
else
|
|
{
|
|
++i;
|
|
count += 4;
|
|
}
|
|
}
|
|
|
|
return count;
|
|
}
|
|
|
|
function toByteArray(str)
|
|
{
|
|
var ret = [];
|
|
for (var i = 0; i < str.length; ++i)
|
|
ret.push(str.charCodeAt(i));
|
|
|
|
return ret;
|
|
}
|
|
|
|
var Bencode =
|
|
{
|
|
EncodeBencodeBinaryString: function(array, str)
|
|
{
|
|
var bytesCount = str.length;
|
|
array.push.apply(array, toByteArray(bytesCount.toString()));
|
|
array.push(":".charCodeAt(0));
|
|
var strBytes = toByteArray(str);
|
|
|
|
for (var i = 0; i < strBytes.length; ++i)
|
|
array.push(strBytes[i]);
|
|
},
|
|
|
|
EncodeBencodeString: function(array, str)
|
|
{
|
|
var bytesCount = stringByteCount(str);
|
|
array.push.apply(array, toByteArray(bytesCount.toString()));
|
|
array.push(":".charCodeAt(0));
|
|
array.push.apply(array, toUTF8Array(str));
|
|
},
|
|
|
|
EncodeBencodeInt: function(array, i)
|
|
{
|
|
array.push("i".charCodeAt(0));
|
|
array.push.apply(array, toUTF8Array(i.toString()));
|
|
array.push("e".charCodeAt(0));
|
|
},
|
|
|
|
EncodeInternal: function(array, obj)
|
|
{
|
|
switch (typeof obj)
|
|
{
|
|
case "string":
|
|
Bencode.EncodeBencodeString(array, obj);
|
|
break;
|
|
case "number":
|
|
Bencode.EncodeBencodeInt(array, obj);
|
|
break;
|
|
case "object":
|
|
Bencode.EncodeObject(array, obj);
|
|
break;
|
|
}
|
|
},
|
|
|
|
EncodeBencodeList: function(array, l)
|
|
{
|
|
array.push("l".charCodeAt(0));
|
|
|
|
for (var i = 0; i < l.length; ++i)
|
|
Bencode.EncodeInternal(array, l[i]);
|
|
|
|
array.push("e".charCodeAt(0));
|
|
},
|
|
|
|
EncodeBencodeDict: function(array, d)
|
|
{
|
|
array.push("d".charCodeAt(0));
|
|
|
|
var sortedKeys = Object.keys(d).sort();
|
|
|
|
for (var i = 0; i < sortedKeys.length; ++i)
|
|
{
|
|
var currentKey = sortedKeys[i];
|
|
Bencode.EncodeInternal(array, currentKey);
|
|
if (currentKey == "pieces")
|
|
Bencode.EncodeBencodeBinaryString(array, d[currentKey]);
|
|
else
|
|
Bencode.EncodeInternal(array, d[currentKey]);
|
|
}
|
|
|
|
array.push("e".charCodeAt(0));
|
|
},
|
|
|
|
EncodeObject: function(array, obj)
|
|
{
|
|
(Array.isArray(obj) ? Bencode.EncodeBencodeList : Bencode.EncodeBencodeDict)(array, obj);
|
|
},
|
|
|
|
EncodeToBytes: function(obj)
|
|
{
|
|
var result = [];
|
|
Bencode.EncodeInternal(result, obj);
|
|
return result;
|
|
}
|
|
};
|
|
function sha1_unrolled(str)
|
|
{
|
|
var convert_hex = function(val)
|
|
{
|
|
var bytes = [];
|
|
for (var i = 3; i >= 0; --i)
|
|
bytes.push((val >>> i * 8) & 0xff);
|
|
return bytes;
|
|
};
|
|
var blockstart;
|
|
var i, j;
|
|
var W = new Uint32Array(80);
|
|
var H0 = 0x67452301;
|
|
var H1 = 0xEFCDAB89;
|
|
var H2 = 0x98BADCFE;
|
|
var H3 = 0x10325476;
|
|
var H4 = 0xC3D2E1F0;
|
|
var A, B, C, D, E;
|
|
var n;
|
|
var temp;
|
|
var str_len = str.length;
|
|
var word_array = [];
|
|
for (i = 0; i < str_len - 3; i += 4)
|
|
{
|
|
j = str[i] << 24 | str[i + 1] << 16 | str[i + 2] << 8 | str[i + 3];
|
|
word_array.push(j);
|
|
}
|
|
switch (str_len & 3)
|
|
{
|
|
case 0:
|
|
i = 0x080000000;
|
|
break;
|
|
case 1:
|
|
i = str[str_len - 1] << 24 | 0x0800000;
|
|
break;
|
|
case 2:
|
|
i = str[str_len - 2] << 24 | str[str_len - 1] << 16 | 0x08000;
|
|
break;
|
|
case 3:
|
|
i = str[str_len - 3] << 24 | str[str_len - 2] << 16 | str[str_len - 1] << 8 | 0x80;
|
|
break;
|
|
}
|
|
word_array.push(i);
|
|
while ((word_array.length & 15) != 14)
|
|
word_array.push(0);
|
|
word_array.push(str_len >>> 29);
|
|
word_array.push((str_len << 3) & 0x0ffffffff);
|
|
for (blockstart = 0; blockstart < word_array.length; blockstart += 16)
|
|
{
|
|
W[0] = word_array[blockstart];
|
|
W[1] = word_array[blockstart + 1];
|
|
W[2] = word_array[blockstart + 2];
|
|
W[3] = word_array[blockstart + 3];
|
|
W[4] = word_array[blockstart + 4];
|
|
W[5] = word_array[blockstart + 5];
|
|
W[6] = word_array[blockstart + 6];
|
|
W[7] = word_array[blockstart + 7];
|
|
W[8] = word_array[blockstart + 8];
|
|
W[9] = word_array[blockstart + 9];
|
|
W[10] = word_array[blockstart + 10];
|
|
W[11] = word_array[blockstart + 11];
|
|
W[12] = word_array[blockstart + 12];
|
|
W[13] = word_array[blockstart + 13];
|
|
W[14] = word_array[blockstart + 14];
|
|
W[15] = word_array[blockstart + 15];
|
|
|
|
n = W[13] ^ W[8] ^ W[2] ^ W[0];
|
|
W[16] = ((n << 1) | (n >>> 31));
|
|
n = W[14] ^ W[9] ^ W[3] ^ W[1];
|
|
W[17] = ((n << 1) | (n >>> 31));
|
|
n = W[15] ^ W[10] ^ W[4] ^ W[2];
|
|
W[18] = ((n << 1) | (n >>> 31));
|
|
n = W[16] ^ W[11] ^ W[5] ^ W[3];
|
|
W[19] = ((n << 1) | (n >>> 31));
|
|
n = W[17] ^ W[12] ^ W[6] ^ W[4];
|
|
W[20] = ((n << 1) | (n >>> 31));
|
|
n = W[18] ^ W[13] ^ W[7] ^ W[5];
|
|
W[21] = ((n << 1) | (n >>> 31));
|
|
n = W[19] ^ W[14] ^ W[8] ^ W[6];
|
|
W[22] = ((n << 1) | (n >>> 31));
|
|
n = W[20] ^ W[15] ^ W[9] ^ W[7];
|
|
W[23] = ((n << 1) | (n >>> 31));
|
|
n = W[21] ^ W[16] ^ W[10] ^ W[8];
|
|
W[24] = ((n << 1) | (n >>> 31));
|
|
n = W[22] ^ W[17] ^ W[11] ^ W[9];
|
|
W[25] = ((n << 1) | (n >>> 31));
|
|
n = W[23] ^ W[18] ^ W[12] ^ W[10];
|
|
W[26] = ((n << 1) | (n >>> 31));
|
|
n = W[24] ^ W[19] ^ W[13] ^ W[11];
|
|
W[27] = ((n << 1) | (n >>> 31));
|
|
n = W[25] ^ W[20] ^ W[14] ^ W[12];
|
|
W[28] = ((n << 1) | (n >>> 31));
|
|
n = W[26] ^ W[21] ^ W[15] ^ W[13];
|
|
W[29] = ((n << 1) | (n >>> 31));
|
|
n = W[27] ^ W[22] ^ W[16] ^ W[14];
|
|
W[30] = ((n << 1) | (n >>> 31));
|
|
n = W[28] ^ W[23] ^ W[17] ^ W[15];
|
|
W[31] = ((n << 1) | (n >>> 31));
|
|
n = W[29] ^ W[24] ^ W[18] ^ W[16];
|
|
W[32] = ((n << 1) | (n >>> 31));
|
|
n = W[30] ^ W[25] ^ W[19] ^ W[17];
|
|
W[33] = ((n << 1) | (n >>> 31));
|
|
n = W[31] ^ W[26] ^ W[20] ^ W[18];
|
|
W[34] = ((n << 1) | (n >>> 31));
|
|
n = W[32] ^ W[27] ^ W[21] ^ W[19];
|
|
W[35] = ((n << 1) | (n >>> 31));
|
|
n = W[33] ^ W[28] ^ W[22] ^ W[20];
|
|
W[36] = ((n << 1) | (n >>> 31));
|
|
n = W[34] ^ W[29] ^ W[23] ^ W[21];
|
|
W[37] = ((n << 1) | (n >>> 31));
|
|
n = W[35] ^ W[30] ^ W[24] ^ W[22];
|
|
W[38] = ((n << 1) | (n >>> 31));
|
|
n = W[36] ^ W[31] ^ W[25] ^ W[23];
|
|
W[39] = ((n << 1) | (n >>> 31));
|
|
n = W[37] ^ W[32] ^ W[26] ^ W[24];
|
|
W[40] = ((n << 1) | (n >>> 31));
|
|
n = W[38] ^ W[33] ^ W[27] ^ W[25];
|
|
W[41] = ((n << 1) | (n >>> 31));
|
|
n = W[39] ^ W[34] ^ W[28] ^ W[26];
|
|
W[42] = ((n << 1) | (n >>> 31));
|
|
n = W[40] ^ W[35] ^ W[29] ^ W[27];
|
|
W[43] = ((n << 1) | (n >>> 31));
|
|
n = W[41] ^ W[36] ^ W[30] ^ W[28];
|
|
W[44] = ((n << 1) | (n >>> 31));
|
|
n = W[42] ^ W[37] ^ W[31] ^ W[29];
|
|
W[45] = ((n << 1) | (n >>> 31));
|
|
n = W[43] ^ W[38] ^ W[32] ^ W[30];
|
|
W[46] = ((n << 1) | (n >>> 31));
|
|
n = W[44] ^ W[39] ^ W[33] ^ W[31];
|
|
W[47] = ((n << 1) | (n >>> 31));
|
|
n = W[45] ^ W[40] ^ W[34] ^ W[32];
|
|
W[48] = ((n << 1) | (n >>> 31));
|
|
n = W[46] ^ W[41] ^ W[35] ^ W[33];
|
|
W[49] = ((n << 1) | (n >>> 31));
|
|
n = W[47] ^ W[42] ^ W[36] ^ W[34];
|
|
W[50] = ((n << 1) | (n >>> 31));
|
|
n = W[48] ^ W[43] ^ W[37] ^ W[35];
|
|
W[51] = ((n << 1) | (n >>> 31));
|
|
n = W[49] ^ W[44] ^ W[38] ^ W[36];
|
|
W[52] = ((n << 1) | (n >>> 31));
|
|
n = W[50] ^ W[45] ^ W[39] ^ W[37];
|
|
W[53] = ((n << 1) | (n >>> 31));
|
|
n = W[51] ^ W[46] ^ W[40] ^ W[38];
|
|
W[54] = ((n << 1) | (n >>> 31));
|
|
n = W[52] ^ W[47] ^ W[41] ^ W[39];
|
|
W[55] = ((n << 1) | (n >>> 31));
|
|
n = W[53] ^ W[48] ^ W[42] ^ W[40];
|
|
W[56] = ((n << 1) | (n >>> 31));
|
|
n = W[54] ^ W[49] ^ W[43] ^ W[41];
|
|
W[57] = ((n << 1) | (n >>> 31));
|
|
n = W[55] ^ W[50] ^ W[44] ^ W[42];
|
|
W[58] = ((n << 1) | (n >>> 31));
|
|
n = W[56] ^ W[51] ^ W[45] ^ W[43];
|
|
W[59] = ((n << 1) | (n >>> 31));
|
|
n = W[57] ^ W[52] ^ W[46] ^ W[44];
|
|
W[60] = ((n << 1) | (n >>> 31));
|
|
n = W[58] ^ W[53] ^ W[47] ^ W[45];
|
|
W[61] = ((n << 1) | (n >>> 31));
|
|
n = W[59] ^ W[54] ^ W[48] ^ W[46];
|
|
W[62] = ((n << 1) | (n >>> 31));
|
|
n = W[60] ^ W[55] ^ W[49] ^ W[47];
|
|
W[63] = ((n << 1) | (n >>> 31));
|
|
n = W[61] ^ W[56] ^ W[50] ^ W[48];
|
|
W[64] = ((n << 1) | (n >>> 31));
|
|
n = W[62] ^ W[57] ^ W[51] ^ W[49];
|
|
W[65] = ((n << 1) | (n >>> 31));
|
|
n = W[63] ^ W[58] ^ W[52] ^ W[50];
|
|
W[66] = ((n << 1) | (n >>> 31));
|
|
n = W[64] ^ W[59] ^ W[53] ^ W[51];
|
|
W[67] = ((n << 1) | (n >>> 31));
|
|
n = W[65] ^ W[60] ^ W[54] ^ W[52];
|
|
W[68] = ((n << 1) | (n >>> 31));
|
|
n = W[66] ^ W[61] ^ W[55] ^ W[53];
|
|
W[69] = ((n << 1) | (n >>> 31));
|
|
n = W[67] ^ W[62] ^ W[56] ^ W[54];
|
|
W[70] = ((n << 1) | (n >>> 31));
|
|
n = W[68] ^ W[63] ^ W[57] ^ W[55];
|
|
W[71] = ((n << 1) | (n >>> 31));
|
|
n = W[69] ^ W[64] ^ W[58] ^ W[56];
|
|
W[72] = ((n << 1) | (n >>> 31));
|
|
n = W[70] ^ W[65] ^ W[59] ^ W[57];
|
|
W[73] = ((n << 1) | (n >>> 31));
|
|
n = W[71] ^ W[66] ^ W[60] ^ W[58];
|
|
W[74] = ((n << 1) | (n >>> 31));
|
|
n = W[72] ^ W[67] ^ W[61] ^ W[59];
|
|
W[75] = ((n << 1) | (n >>> 31));
|
|
n = W[73] ^ W[68] ^ W[62] ^ W[60];
|
|
W[76] = ((n << 1) | (n >>> 31));
|
|
n = W[74] ^ W[69] ^ W[63] ^ W[61];
|
|
W[77] = ((n << 1) | (n >>> 31));
|
|
n = W[75] ^ W[70] ^ W[64] ^ W[62];
|
|
W[78] = ((n << 1) | (n >>> 31));
|
|
n = W[76] ^ W[71] ^ W[65] ^ W[63];
|
|
W[79] = ((n << 1) | (n >>> 31));
|
|
|
|
A = H0;
|
|
B = H1;
|
|
C = H2;
|
|
D = H3;
|
|
E = H4;
|
|
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[0] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[1] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[2] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[3] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[4] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[5] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[6] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[7] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[8] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[9] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[10] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[11] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[12] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[13] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[14] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[15] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[16] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[17] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[18] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (~B & D)) + E + W[19] + 0x5A827999) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[20] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[21] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[22] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[23] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[24] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[25] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[26] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[27] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[28] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[29] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[30] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[31] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[32] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[33] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[34] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[35] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[36] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[37] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[38] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[39] + 0x6ED9EBA1) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[40] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[41] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[42] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[43] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[44] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[45] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[46] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[47] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[48] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[49] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[50] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[51] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[52] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[53] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[54] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[55] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[56] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[57] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[58] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + ((B & C) | (B & D) | (C & D)) + E + W[59] + 0x8F1BBCDC) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[60] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[61] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[62] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[63] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[64] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[65] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[66] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[67] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[68] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[69] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[70] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[71] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[72] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[73] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[74] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[75] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[76] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[77] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[78] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
temp = (((A << 5) | (A >>> 27)) + (B ^ C ^ D) + E + W[79] + 0xCA62C1D6) & 0x0ffffffff;
|
|
E = D;
|
|
D = C;
|
|
C = (B << 30) | (B >>> 2);
|
|
B = A;
|
|
A = temp;
|
|
|
|
H0 = (H0 + A) & 0x0ffffffff;
|
|
H1 = (H1 + B) & 0x0ffffffff;
|
|
H2 = (H2 + C) & 0x0ffffffff;
|
|
H3 = (H3 + D) & 0x0ffffffff;
|
|
H4 = (H4 + E) & 0x0ffffffff;
|
|
}
|
|
|
|
temp = convert_hex(H0).concat(convert_hex(H1), convert_hex(H2), convert_hex(H3), convert_hex(H4));
|
|
return temp;
|
|
}
|
|
</script>
|
|
<script>
|
|
if (typeof WebAssembly === "object")
|
|
{
|
|
var sha1wasm;
|
|
var nothingFunction = function() { };
|
|
var importObject =
|
|
{
|
|
env:
|
|
{
|
|
_ZdaPv: nothingFunction,
|
|
_Znaj: nothingFunction,
|
|
memset: nothingFunction,
|
|
_ZdaPv: nothingFunction,
|
|
_ZdaPv: nothingFunction,
|
|
},
|
|
};
|
|
var wasmBytes = new Int32Array([1836278016,1,-2139057919,1610809472,2130804481,8323424,2139030368,41877887,-2139062105,1694696192,1594259054,1348559962,50397302,91647589,1634622047,50331754,108424805,1936549229,33584229,-2139061757,16842880,-2139061244,1879113856,-2096824320,8421504,100728833,-2139062143,-1861812224,8421504,1701643778,2037542765,1929641986,3236200,-1515124221,16810112,-2139052629,2130838272,2136309249,371261505,2129729,-2139029459,272697472,754983028,-2139062272,1092297224,544371736,-2113917696,1091076224,544371720,-2097140480,570982528,354578973,578159169,538853714,1778467154,577834817,239168338,577458720,1095901266,572213248,54618647,-1392434582,579207746,52471555,-1484251070,553717787,541065730,1786593557,21041954,536874312,542646528,1786528021,1098252865,371354113,35673889,1073960481,1478514208,570425384,1947746642,138498592,-2139078284,1920010236,138498592,-25149066,1377857795,1920342081,145010,71391264,542646634,1778663766,1461736993,577404737,184552791,37749259,541065792,1896038685,54612514,536874310,1174552914,-2143223539,2021687424,1377851425,222757185,536879106,2134993429,11626,1098127425,75530368,207102322,2099970,761926432,406913024,536879220,1377987093,761953857,272695296,1377858164,761954113,138477568,-2143194508,1478586881,537592076,1779769344,2118210082,11626,544479297,1786724690,1090519085,1098019856,1912766592,537614369,1091969026,543847426,144984,1394671681,371196448,577372481,1946304850,536887658,1946304791,538575376,542253058,37841431,1377987188,88152864,145014,71389728,1091903594,37123075,37749248,1157701696,35651597,560610369,-1007664814,561815243,-1460256428,553746889,-1174519467,561628651,-678870698,561970870,-964607657,554089108,541066072,1095901272,36203112,537862656,1784693074,570425896,1377858317,570425896,1377858325,678059073,237109250,1413567008,141418,544410658,1786003794,570425896,1377858324,678056001,102891522,1212240416,141418,544409890,1377858319,678067265,371326978,1996570995,1098061602,455243521,1996570995,220208418,1480675872,141418,544410402,1786265938,570425896,203453203,1279349280,141418,544409378,1785479506,570425896,354448146,1996570995,1098062370,472020737,538255475,471888659,538189939,438334226,1931288691,578224449,21066530,1931747959,438311712,1931616371,354424608,1931288691,337647136,1931157619,1883329056,141418,253759778,1930895475,1682002464,141418,236982306,1930829939,102763296,1930502259,1377830688,678052929,170000386,1930436723,1098060576,404911873,1996570995,1098062114,505575169,1996570995,1098063906,589461249,1996570995,1098065186,706901761,1996570995,471870498,544413984,1930502163,544413984,1930436626,544413728,21066524,1931420279,578224449,438334241,544413728,606106399,1996570995,1098065698,690124545,539238515,689992481,539107443,656438047,1932271731,578224449,21066543,1932599927,656419360,1932468339,606086432,1932271731,572531488,1932140659,488644640,1931812979,455089696,1931681907,387979552,1931485299,371202080,1931354227,1098064160,639792897,1996570995,1098065954,723678977,1996570995,1098067234,841119489,1996570995,1098069026,925005569,1996570995,689977634,544417824,1931485217,544417824,1931354143,544417312,21066537,1932403319,578224449,656438064,544417312,824210222,1996570995,1098069538,941782785,540090483,941650736,539959411,908096302,1933123699,578224449,21066558,1933582967,908080928,1933451379,824194080,1933123699,790639136,1932992627,740306208,1932796019,706751264,1932664947,622864416,1932337267,589309472,1932206195,1098068000,857896705,1996570995,1098069282,975337217,1996570995,1098071074,1059223297,1996570995,1098072354,1176663809,1996570995,941639714,544421152,1932337200,544421152,1932206126,544420640,21066552,1933255287,578224449,908096317,544420640,1075868475,1996570995,1098072866,1159886593,541073523,1159754557,540942451,1126200123,1934106739,578224449,21066571,1934434935,1126188576,1934303347,1075855648,1934106739,1042300704,1933975667,958413856,1933647987,924858912,1933516915,874525984,1933320307,840971040,1933189235,1098071328,1109554945,1996570995,1098073122,1193441025,1996570995,1098074402,1310881537,1996570995,1098075938,1361213185,1996570995,541270122,991982402,544422432,1159754562,1996570995,544426530,21066573,542122615,1933320253,544424992,21066570,541860471,541139015,540549182,539828275,539238442,538517535,1096294412,86144798,537337962,1461742166,544298528,1096228949,1920037759,543839264,1996833112,1779048554,-1723791582,97815027,537666154,-431918843,2058090124,543885088,1998471511,1920010018,537337962,1444966744,2134988832,544371059,153119317,1091313770,577402629,-208060156,1778766985,88168482,136473207,-1980524223,577373652,1096294409,170030878,-1931067023,544910326,203451144,578231873,1785884940,119539232,542646378,-431918836,2058090124,543884320,1785884933,88148256,86141559,-1980524223,577373652,1996833112,1090789994,-729156711,102918661,578231873,1779376135,507578656,537862775,186673677,543820832,1896816728,-158538175,86014635,1896489067,102787698,1786185025,-1723790302,97815027,537731690,-431918841,2058090124,543886368,1998471512,1920030754,537534570,102787598,1097947168,-1409905434,1795432570,1920012064,1091379306,577402629,-208060154,1778766985,88149794,186804855,-1980524223,577373652,1091510286,203585310,-1931067023,544910326,220228363,578231873,1785884941,270555168,537862250,-431918835,2058090124,543884832,1785884935,88149536,102918775,-1980524223,577373652,1996833112,1091248746,-729156711,253913605,578231873,1779834896,507579936,538321527,220228116,543822368,1897275480,-158538175,102791851,1896620139,253782642,1786185025,-1723788766,97815027,538190442,-431918832,2058090124,543887904,1998471512,1920030754,537665642,253782545,1097947168,-1409905434,1795891322,1920013856,1091838058,577402629,-208060143,1778766985,88151586,220359287,-1980524223,577373652,1091969039,304248606,-1931067023,544910326,337668877,578231873,1785884948,320886816,538321002,-431918828,2058090124,543887648,1785884944,88149792,287468151,-1980524223,577373652,1996833112,1091576426,-729156711,371354117,578231873,253782547,578231873,1779900441,354423840,542646378,-431918823,2058090124,543887648,1785884946,88151584,388131447,-1980524223,577373652,1897078805,-158538175,388004523,1096294507,1478653726,543847025,1779965970,1478497824,-1931067023,544910326,421554960,543847025,1996833045,1092166250,-729156711,371354117,1786185025,-1723789534,97815027,538387050,1998471446,1097930786,-1409905434,1796153466,507581728,1897210487,438332018,543840288,1897209878,-158538175,421558955,1897078891,388000370,1786185025,-1980524223,577373652,1996833112,-208060054,1778766985,507581986,1779638903,404757536,1096294506,438466334,507582240,1930895991,1785927200,354425632,538386538,1478521624,371223155,1786185025,-405298879,577373942,1996833112,-677297814,1778841319,507581730,538321527,1998471512,544414498,1779900446,438309664,1935155315,1091903594,1097496325,-152578143,1478650374,488663667,543824416,1930633243,1785926944,88168480,-1589548425,116844503,1091904106,1097496325,-152578143,388131334,578231873,572549661,543823392,1998471445,1478497058,578231873,388002648,538995315,543824672,1930829912,1785926944,88151840,-1589548425,116844503,1091904106,1097496325,-152578143,371354118,578231873,1091903511,455243550,539041907,488663640,544412448,543847189,1996833046,-677297814,1778841319,1785944098,320873248,538648682,371225373,1478519411,1786185025,-405298879,577373942,1996833045,-677297814,1778841319,507581986,1780294263,387982624,1091903594,321025822,507598880,1935155831,1785927200,455091744,542646378,354448151,371223155,1786185025,-405298879,577373942,1996833045,-677297814,1778841319,507581986,538387063,1998471445,544414498,1784160295,320871712,1930764403,1091969130,1097496325,-152578143,1478650374,673213043,543822624,1931288603,1785927200,88168480,-1589548425,116844503,1091904106,1097496325,-152578143,371354118,578231873,723544605,543823648,1998471445,1478497058,578231873,371225432,689990259,543824672,1930895448,1785926944,88151584,-1589548425,116844503,1091904106,1097496325,-152578143,371354118,578231873,1091903511,455243550,539762803,488663640,544412448,543847189,1996833046,-677297814,1778841319,1785926946,320876064,538648682,371225373,354445939,1786185025,-405298879,577373942,1996833046,-677297814,1778841319,507583778,1784160887,354431520,578231873,790653461,543824672,538255382,544305687,1897340949,488663666,1786185025,-285615039,577403128,542646299,1998471446,1903302178,371218464,543847025,1779900464,371203360,1903301920,354424352,543847025,1996833051,-103005846,1786312942,88153378,-599692681,2029580025,538124906,1998471453,455087394,578231873,544305687,1897340949,824207986,543823392,538386461,544305752,1901600791,320891506,1786185025,-285615039,577403128,1996833051,-103005846,1786312942,507583778,1784160887,320877856,578231873,874539542,543823648,538320923,544305685,1897209878,488663666,1786185025,-285615039,577403128,542646291,1998471451,1903302434,387995680,543847025,1779769398,387980576,1903302176,371201824,543847025,1996833043,-103005846,1786312942,88152866,-599692681,2029580025,538780266,1998471451,320869666,578231873,544305686,1897275413,924871282,543823648,538320923,544305752,1901600790,488663666,1786185025,-285615039,577403128,1996833051,-103005846,1786312942,507581218,1784160887,488651552,578231873,975202839,543823392,538386459,544305685,1897209879,320891506,1786185025,-285615039,577403128,542646301,1998471451,1903302178,371218464,543847025,1779769401,371200800,1903302432,387978784,543847025,1996833053,-103005846,1786312942,88152866,-599692681,2029580025,538124906,1998471451,488641826,578231873,544305687,1897340949,1008757362,543823392,538386459,544305752,1901600791,320891506,1786185025,-285615039,577403128,1996833051,-103005846,1786312942,507583778,1784160887,320880672,578231873,1025534486,543823648,538320923,544305685,1897209878,488663666,1786185025,-285615039,577403128,542646291,1998471451,1903302434,387995680,543847025,1779769407,387980576,1903302176,371201824,543847025,1996833043,-103005846,1786312942,88152866,-599692681,2029580025,538780266,1998471451,320869922,578231873,544305685,1897209878,1109420658,543823648,538255387,544305752,1901600789,488663666,1786185025,-285615039,577403128,1996833112,-103005846,1786312942,507582242,1780163191,371213344,1096294506,321025822,507583776,1931289207,1785927456,354435872,538779754,1478521622,388000371,1786185025,-1954294207,577404115,1996833112,-2083110550,1786565515,507581730,538321527,1998471512,544413474,1780293702,320871200,1935155315,1091903594,1097496325,-745831466,1478650492,1159752307,543822624,1931157527,1785926944,88168480,-700355977,2094238595,1091904106,1097496325,-745831466,455240316,578231873,1243638301,543823392,1998471445,1478497058,578231873,455111512,1210083955,543823648,1930829912,1785926944,88152864,-700355977,2094238595,1091904106,1097496325,-745831466,371354236,578231873,1091903511,455243550,541663347,488663640,544412448,543847189,1996833046,-2083110550,1786565515,1785944098,320883488,538648682,371225373,1478519411,1786185025,-1954294207,577404115,1996833045,-2083110550,1786565515,507581986,1780294263,387992864,1091903594,321025822,507598880,1935155831,1785927200,455101984,542646378,354448151,371223155,1786185025,-1954294207,577404115,1996833045,-2083110550,1786565515,507581986,538387063,1998471445,544414498,1933516866,544425760,21066572,538583671,488663640,544412448,543847189,1996833046,-2083110550,1786565515,1785944098,320884512,538648682,371225373,1478519411,1786185025,-1954294207,577404115,1996833045,-2083110550,1786565515,507581986,1780294263,387993888,1091903594,321025822,507598880,1935155831,1785927200,1092633632,1934172275,1098062368,438466305,543824672,1930895448,1785926944,88151584,-700355977,2094238595,1091904106,1097496325,-745831466,371354236,578231873,1091903515,388134686,541401203,1277195076,1934631027,544670017,488663640,544412448,543847189,1996833046,-2083110550,1786565515,1785926946,1176520480,1934499955,1098062368,320894721,538386538,371225373,354445939,1786185025,-1954294207,577404115,1996833046,-2083110550,1786565515,371218465,560617248,1091903575,1444968222,542515562,1783898135,455103521,560616736,1095901269,560595136,1095966802,1394764304,222888224,184683520,-964607733,554089108,-678870696,561970870,-1174519465,561628651,-1460256426,553746889,-1007664811,561815243,35654484,2097168,272717856,-2063582602,537428096,1096294400,3831320,142639236,1478492192,980813889,-2139060736,536879112,-2030028200,537428096,1096228864,3831320,142639240,1461714976,980815937,-2139059968,536879112,1980252503,-2138439622,2099328,3823392,142639243,1444937760,980817985,-2139059200,536879112,1980776790,-2138243014,2099328,138499616,-1912587658,537428096,978722816,-2139058432,536879112,1981301077,-2138046406,2099328,272717088,-1862256010,537428096,1096097792,3831304,142639250,1428160544,-2137849798,2099328,406934560,-1811924362,537428096,1096032256,3831312,142639253,1411383328,980813889,-2139056640,536879112,-1761592748,185106560]);
|
|
var sharedMemoryBuffer;
|
|
WebAssembly.instantiate(wasmBytes, importObject).then(function(obj)
|
|
{
|
|
sha1wasm = obj.instance.exports.sha1;
|
|
var memory = obj.instance.exports.memory;
|
|
memory.grow(256);
|
|
sharedMemoryBuffer = new Uint8Array(memory.buffer);
|
|
});
|
|
var emptyArray = new Uint8Array(20);
|
|
sha1func = function(bytes)
|
|
{
|
|
var byteCount = bytes.length;
|
|
|
|
if (byteCount < blockSize)
|
|
sharedMemoryBuffer.set(new Uint8Array(blockSize - byteCount + 4), byteCount);
|
|
else
|
|
{
|
|
sharedMemoryBuffer[blockSize] = 0;
|
|
sharedMemoryBuffer[blockSize + 1] = 0;
|
|
sharedMemoryBuffer[blockSize + 2] = 0;
|
|
sharedMemoryBuffer[blockSize + 3] = 0;
|
|
}
|
|
|
|
sharedMemoryBuffer.set(bytes, 0);
|
|
sharedMemoryBuffer[16777216] = byteCount >> 24;
|
|
sharedMemoryBuffer[16777217] = (byteCount >> 16) & 0xff;
|
|
sharedMemoryBuffer[16777218] = (byteCount >> 8) & 0xff;
|
|
sharedMemoryBuffer[16777219] = byteCount & 0xff;
|
|
|
|
sha1wasm(0);
|
|
|
|
var ret = sharedMemoryBuffer.slice(16777220, 16777240);
|
|
sharedMemoryBuffer.set(emptyArray, 16777220);
|
|
return ret;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
document.getElementById("no_wasm_warning").style.display = "block";
|
|
sha1func = sha1_unrolled;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |