wg-lua/examples/basic.luau

18 lines
501 B
Lua
Raw Normal View History

2024-03-28 10:27:29 +00:00
local datetime = require("@lune/datetime")
local wg = require("../out").wireguard
function main()
print(`{datetime.now():formatLocalTime()} | Generating keypair`)
local start = os.clock()
local keypair = wg:generateKeypair()
print(`{datetime.now():formatLocalTime()} | Generated keypair in {os.clock() - start}s`)
print("---------------------------------------------------------------")
print(`Private Key: {keypair.privateKey}`)
print(`Public Key: {keypair.publicKey}`)
end
return main()