I need to convert a sip callId (eg. 1097074724_100640573@8.8,8.8) string into requestId and I am using sha1 digest to get a hash. I need to convert this hex-decimal into uint64_t due to internal compatibility:
--
-- Obtain request-id from callId
--
-- Returns hash
--
function common_get_request_id( callId )
local command = "echo -n \"" .. callId .. "\" | openssl sha1 | sed 's/(stdin)= //g'"
local handle = assert( io.popen( command, "r" ) )
local output = handle:read( "*all" )
local outputHash = string.gsub(output, "\n", "") -- strip newline
handle:close()
-- How to convert outputHash to uint64?
end
I am not sure about uint64 support in Lua. Also, how to do the conversion?