blob: 10714b75613dbaddae15b2755cac31f8b8c9f659 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
--
-- ~~~ response signature utils
--
require("src/utils")
-- get length of signature
function getSignatureLength(response)
return tonumber(table.extracthex(response, 13, 14), 16)
end
-- get signature
function getSignature(response)
local signatureIndexEnd = 14 + getSignatureLength(response)
return table.extracthex(response, 15, signatureIndexEnd)
end
-- validate signature
function validateSignature(signature, key)
-- todo: this
return true
end
-- return
return {
length = getSignatureLength,
get = getSignature,
validate = validateSignature
}
|