working commit

This commit is contained in:
2026-06-05 18:25:03 +02:00
commit 7d8abba003
82 changed files with 21863 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package auxpwd
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestPasswd256(t *testing.T) {
password := []byte("123456781")
wrongPasswd := []byte("qwerty")
hash := MakeSHA256Hash(password)
fmt.Printf("%s\n", hash)
{
match := PasswordMatchCompat(password, hash)
require.Equal(t, true, match)
}
{
match := PasswordMatchCompat(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 := PasswordMatchCompat(password, hash)
require.Equal(t, true, match)
}
{
match := PasswordMatchCompat(wrongPasswd, hash)
require.NotEqual(t, true, match)
}
}