working commit

This commit is contained in:
2026-05-26 17:11:13 +02:00
commit 2e59f88d76
103 changed files with 18276 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*/
package auxpwd
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestPasswd256(t *testing.T) {
password := []byte("123456789")
wrongPasswd := []byte("qwerty")
hash := MakeSHA256Hash(password)
fmt.Printf("%s\n", hash)
{
match := PasswordMatch(password, hash)
require.Equal(t, true, match)
}
{
match := PasswordMatch(wrongPasswd, hash)
require.NotEqual(t, true, match)
}
}
func TestPasswd512(t *testing.T) {
password := []byte("123456781")
wrongPasswd := []byte("qwerty")
hash := MakeSHA512Hash(password)
fmt.Printf("%s\n", hash)
{
match := PasswordMatch(password, hash)
require.Equal(t, true, match)
}
{
match := PasswordMatch(wrongPasswd, hash)
require.NotEqual(t, true, match)
}
}