mirror of
https://github.com/0x5eal/wg-lua.git
synced 2024-12-12 12:50:36 +00:00
chore: include README
This commit is contained in:
parent
cccbfb22bc
commit
ce7cea38c3
1 changed files with 45 additions and 0 deletions
45
README.md
Normal file
45
README.md
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<img align="right" src="https://www.wireguard.com/img/icons/favicon-256.png" />
|
||||||
|
|
||||||
|
# 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 <path>
|
||||||
|
```
|
||||||
|
|
||||||
|
Run an example with:
|
||||||
|
|
||||||
|
```console
|
||||||
|
./lunew example <example-name>
|
||||||
|
```
|
||||||
|
```
|
Loading…
Reference in a new issue