net/stun.lua
changeset 12363 f81488951f81
parent 12360 0f77e28df5c8
child 12364 0801db678f5e
--- 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