Documentation ¶
Overview ¶
Package crypto implements golang package crypto functionality for lua.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MD5 ¶
MD5 lua crypto.md5(string) return string
Example ¶
crypto.md5(string)
state := lua.NewState() Preload(state) source := ` local crypto = require("crypto") print(crypto.md5("1\n")) ` if err := state.DoString(source); err != nil { log.Fatal(err.Error()) }
Output: b026324c6904b2a9cb4b88d6d61c81d1
func Preload ¶
Preload adds crypto to the given Lua state's package.preload table. After it has been preloaded, it can be loaded using require:
local crypto = require("crypto")
func SHA256 ¶
SHA256 lua crypto.sha256(string) return string
Example ¶
crypto.sha256(string)
state := lua.NewState() Preload(state) source := ` local crypto = require("crypto") print(crypto.sha256("1\n")) ` if err := state.DoString(source); err != nil { log.Fatal(err.Error()) }
Output: 4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.