From ce7cea38c383d9a6d213f0606a0e5bc9c176e68f Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Thu, 28 Mar 2024 17:10:39 +0530 Subject: [PATCH] chore: include README --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c53bf5 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ + + +# wg-lua + +A lua implementation of the wireguard keygen algorithm. + +```lua +local wg = require("wg").wireguard +local keypair = wg:generateKeypair() + +print("Public Key: ", keypair.publicKey) +print("Private Key: ", keypair.privateKey) + +print(wg:generatePublicKey(keypair.privateKey)) +``` +## Methods + +- #### Wireguard:generateKeypair() -> { publicKey: string, privateKey: string } + > Generates a wireguard keypair consisting of a public and private key. +- #### Wireguard:generatePublicKey(privateKey: number[]) -> string + > Generates a wireguard public key, given a private key. + +## Development + +To get started, install the required dependencies with: +```console +aftman install +pnpm i +``` +Run tests with: +```console +pnpm test +``` + +Run any luau file with: +```console +./lunew +``` + +Run an example with: + +```console +./lunew example +``` +```