prosody-password/internal/services/prosody/change_password_test.go

20 lines
430 B
Go
Raw Normal View History

2023-08-09 20:03:29 +02:00
package prosody
import (
"testing"
"github.com/stretchr/testify/require"
)
func Test_hashPassword(t *testing.T) {
password := "test"
salt := "317d9b92-38a4-44fb-b540-099e35fd23f7"
accStoredKey := "3e7ac415b43be64e3935d32c447a11fe7a36cb9c"
iterationCount := 10000
storedKey, err := hashPassword(password, salt, iterationCount)
require.NoError(t, err)
// Compare the hashes
require.Equal(t, storedKey, accStoredKey)
}