13 lines
270 B
Lua
13 lines
270 B
Lua
local Util = {}
|
|
|
|
function Util.valueToHex(value)
|
|
local collect = {}
|
|
while value > 0 do
|
|
local idx = value % 16
|
|
table.insert(collect, 1, ("0123456789ABCDEF"):sub(idx, idx))
|
|
value = bit.brshift(value, 4)
|
|
end
|
|
return table.concat(collect)
|
|
end
|
|
|
|
return Util |