aboutsummaryrefslogtreecommitdiff
path: root/entropy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'entropy.lua')
-rw-r--r--entropy.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/entropy.lua b/entropy.lua
index d36a8a9..f09dc1e 100644
--- a/entropy.lua
+++ b/entropy.lua
@@ -4,6 +4,7 @@
---------------------------------------------------
-- {{{ Grab environment
+local tonumber = tonumber
local io = { open = io.open }
local setmetatable = setmetatable
local math = { ceil = math.ceil }
@@ -21,7 +22,7 @@ local function worker(format, poolsize)
-- Get available entropy
local f = io.open("/proc/sys/kernel/random/entropy_avail")
- local ent = f:read("*line")
+ local ent = tonumber(f:read("*line"))
f:close()
-- Calculate percentage