First of all, I should mention that I am really very new to Lua and please be patient if you think my question is too stupid
Here is my requirement
- I need to use HMAC-sha256 to develop Lightroom plugins, as I use this for security.
I tried to use this but no luck
https://code.google.com/p/lua-files/wiki/hmac
These are the steps that I followed.
Now in the file I use it as follows
local hmac = require'hmac'
local sha2 = require'sha2'
--somewhere doend the line inside a function
local hashvalue = hmac.sha2('key', 'message')
but unfortunately this does not work, and I'm not sure what I'm doing wrong. Can someone advise me what I'm doing wrong here? Or there is an easier and better way to do this with a good example.
EDIT: I do this to get the result. When I include this code, the plugin stops working. I can not get the output line when I do this
hashvalue = hmac.sha2('key', 'message')
local LrLogger = import 'LrLogger'
myLogger = LrLogger('FlaggedFiles')
myLogger:enable("logfile")
myLogger:trace ("=========================================\n")
myLogger:trace ('Winter is coming, ' .. hashvalue)
myLogger:trace ("=========================================\n")
and Lightroom refuses to download the plugin, and there is nothing in the magazine.
Many thanks for your help.
source
share