testing routine

This commit is contained in:
2025-01-21 22:30:14 +01:00
parent f814e3a1f9
commit 0c9621ef70
3 changed files with 60 additions and 1 deletions

24
main.go
View File

@@ -1 +1,25 @@
package main
import (
"fmt"
"git.send.nrw/sendnrw/sendnrwlib/netcrypto"
"git.send.nrw/sendnrw/sendnrwlib/netproto"
)
func main() {
key, _ := netcrypto.AES_GenerateKey()
fmt.Println(netcrypto.AES_KeyToString(key))
enc, _ := netcrypto.AES_Encrypt("test", key)
fmt.Println(enc)
dec, _ := netcrypto.AES_Decrypt(enc, key)
fmt.Println(dec)
a := netproto.GenerateNetworkProtocol(netproto.GenerateMainHeader(1, "A", netproto.GenerateEHT1("127.0.0.1", "", ""), netproto.GenerateEHT2("8.8.8.8", "", "80"), netproto.GenerateEHT3("JSON", "0", "0")), "")
fmt.Println(a)
b, _ := netproto.ToJSON(a)
fmt.Println(b)
netproto.FromJSON(b, &a)
fmt.Println(a)
}