crypto

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

README

crypto GoDoc

Lua module for crypto (md5 and sha256).

Functions

  • md5(string) - return md5 checksum from string.
  • sha256(string) - return sha256 checksum from string.

Examples

local crypto = require("crypto")

-- md5
if not(crypto.md5("1\n") == "b026324c6904b2a9cb4b88d6d61c81d1") then
    error("md5")
end

-- sha256
if not(crypto.sha256("1\n") == "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865") then
    error("sha256")
end

Documentation

Overview

Package crypto implements golang package crypto functionality for lua.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func MD5

func MD5(L *lua.LState) int

MD5 lua crypto.md5(string) return string

func Preload

func Preload(L *lua.LState)

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

func SHA256(L *lua.LState) int

SHA256 lua crypto.sha256(string) return string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL