Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
package account
import "testing"
func TestPasswordHashAndVerify(t *testing.T) {
hash, err := HashPassword("correct horse battery staple")
if err != nil {
t.Fatalf("HashPassword: %v", err)
}
if hash == "correct horse battery staple" {
t.Fatal("password was stored in plaintext")
}
if ok, err := VerifyPassword("correct horse battery staple", hash); err != nil || !ok {
t.Fatalf("correct password rejected: ok=%v err=%v", ok, err)
}
if ok, err := VerifyPassword("wrong", hash); err != nil || ok {
t.Fatalf("wrong password accepted: ok=%v err=%v", ok, err)
}
}
func TestVerifyPasswordRejectsMalformedHash(t *testing.T) {
if ok, err := VerifyPassword("password", "not-an-argon2-hash"); err == nil || ok {
t.Fatalf("malformed hash accepted: ok=%v err=%v", ok, err)
}
}