aboutsummaryrefslogtreecommitdiffstats
path: root/util/bit53.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-06-28 03:56:45 +0200
committerKim Alvefur <zash@zash.se>2021-06-28 03:56:45 +0200
commit27943c671cab85e37cac86e96f9bd0a064c1c689 (patch)
tree77e8e628d5a10077c5ed174a12bcbed1a468e3c4 /util/bit53.lua
parente01f2cf25fa35e6525dd12d6063d53065d2d8c33 (diff)
downloadprosody-27943c671cab85e37cac86e96f9bd0a064c1c689.tar.gz
prosody-27943c671cab85e37cac86e96f9bd0a064c1c689.zip
util.bit53: Add left- and right shift operations
While not used by anything in Prosody, it is known to be used by some 3rd party modules.
Diffstat (limited to 'util/bit53.lua')
-rw-r--r--util/bit53.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/bit53.lua b/util/bit53.lua
index 4b5c2e9c..06799a97 100644
--- a/util/bit53.lua
+++ b/util/bit53.lua
@@ -3,5 +3,7 @@ return {
band = function (a, b) return a & b end;
bor = function (a, b) return a | b end;
bxor = function (a, b) return a ~ b end;
+ rshift = function (a, n) return a >> n end;
+ lshift = function (a, n) return a << n end;
};