Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit e35b27da authored by deuce's avatar deuce

Clean up to make syncjslint happier.

Support hashed user IDs as well (some clients don't optionally support them.)
Support Blowfish and IDEA encryption.
parent b20706ee
This diff is collapsed.
function encode_integer(val)
{
var ret ='';
val = parseInt(val, 10);
if (val < 0)
val = Math.pow(2, 32) + val;
while(val) {
ret = ascii(val & 0xff)+ret;
// We can't shift here or it will convert to 32-bit signed first.
val = Math.floor(val/256);
}
while (ret.length < 2)
ret = ascii(0)+ret;
if (ret.length == 3)
ret = ascii(0)+ret;
if (ret.length == 1 || ret.length == 0 || ret.length == 3 || ret.length > 4)
rage_quit("Invalid int length!");
return ret;
}
function encode_long(val)
{
var ret= encode_integer(val);
while (ret.length < 4)
ret = ascii(0)+ret;
return ret;
}
function encode_short(val)
{
var ret = encode_integer(val);
if (ret.length > 2)
rage_quit("Integer too long!");
return ret;
}
function address_to_bin(addr)
{
var m;
......@@ -64,42 +103,3 @@ function decode_integer(val)
}
return ret;
}
function encode_integer(val)
{
var ret ='';
val = parseInt(val, 10);
if (val < 0)
val = Math.pow(2, 32) + val;
while(val) {
ret = ascii(val & 0xff)+ret;
// We can't shift here or it will convert to 32-bit signed first.
val = Math.floor(val/256);
}
while (ret.length < 2)
ret = ascii(0)+ret;
if (ret.length == 3)
ret = ascii(0)+ret;
if (ret.length == 1 || ret.length == 0 || ret.length == 3 || ret.length > 4)
rage_quit("Invalid int length!");
return ret;
}
function encode_long(val)
{
var ret= encode_integer(val);
while (ret.length < 4)
ret = ascii(0)+ret;
return ret;
}
function encode_short(val)
{
var ret = encode_integer(val);
if (ret.length > 2)
rage_quit("Integer too long!");
return ret;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment