net.stun: Use util.strbitop
Improves performance since the whole procedure is done in C
--- a/net/stun.lua Mon Jun 28 03:56:45 2021 +0200
+++ b/net/stun.lua Fri Mar 04 16:55:32 2022 +0100
@@ -3,17 +3,7 @@
local net = require "util.net";
local random = require "util.random";
local struct = require "util.struct";
-
---- Private helpers
-
--- XORs a string with another string
-local function sxor(x, y)
- local r = {};
- for i = 1, #x do
- r[i] = string.char(bit32.bxor(x:byte(i), y:byte(i)));
- end
- return table.concat(r);
-end
+local sxor = require"util.strbitop".sxor;
--- Public helpers