Comparison

util/uuid.lua @ 12975:d10957394a3c

util: Prefix module imports with prosody namespace
author Kim Alvefur <zash@zash.se>
date Fri, 17 Mar 2023 16:23:16 +0100
parent 12355:a0ff5c438e9d
comparison
equal deleted inserted replaced
12974:ba409c67353b 12975:d10957394a3c
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local random = require "util.random"; 9 local random = require "prosody.util.random";
10 local random_bytes = random.bytes; 10 local random_bytes = random.bytes;
11 local hex = require "util.hex".encode; 11 local hex = require "prosody.util.hex".encode;
12 local m_ceil = math.ceil; 12 local m_ceil = math.ceil;
13 13
14 local function get_nibbles(n) 14 local function get_nibbles(n)
15 return hex(random_bytes(m_ceil(n/2))):sub(1, n); 15 return hex(random_bytes(m_ceil(n/2))):sub(1, n);
16 end 16 end