Initial commit - express server, where citysys-terminal app is uploaded

This commit is contained in:
rasta5man 2024-04-15 19:46:51 +02:00
commit c4065c3f9c
9 changed files with 1623 additions and 0 deletions

43
bit.js Normal file
View file

@ -0,0 +1,43 @@
//http://lua-users.org/wiki/BitwiseOperators
//https://basicer.com/lua2js/
class bit {
static lshift(x, n)
{
return x << n;
}
static rshift(x, n)
{
return x >> n;
}
//bit.bor(x1[,x2...]) -- bitwise or of x1, x2, ...
static bor(...args)
{
let v = args[0];
if(args.length === 1) return v;
for (var i = 1; i < args.length; i++) {
v = v | args[i];
}
return v;
}
//bit.band(x1[,x2...]) -- bitwise and of x1, x2, ...
static band(...args)
{
let v = args[0];
if(args.length === 1) return v;
for (var i = 1; i < args.length; i++) {
v = v & args[i];
}
return v;
}
}
module.exports = bit