encryption + helpers + contact card compression + server routing start

This commit is contained in:
ycc
2022-10-22 14:41:48 +02:00
parent 2160babeae
commit fc3747a124
15 changed files with 350 additions and 24 deletions

21
contactcard_test.go Normal file
View File

@ -0,0 +1,21 @@
package meowlib
import (
"testing"
)
func TestCompress(t *testing.T) {
kp1 := NewKeyPair()
kp2 := NewKeyPair()
kp3 := NewKeyPair()
var cc ContactCard
cc.Name = "My Full Name And It's loooong"
cc.ContactPublicKey = kp1.Public
cc.EncryptionPublicKey = kp2.Public
cc.LookupPublicKey = kp3.Public
cc.AddUrls([]string{"https://meow.myfirstdomain.com/services/meow:8080", "https://meow.myseconddomain.com/services/meow:8080", "http://meow.mythirddomain.com/services/meow:8080"})
serialized, _ := cc.Serialize()
println(len(serialized))
compressed, _ := cc.Compress()
println(len(compressed))
}