scrypt_test.go 293 B

12345678910111213141516171819
  1. package crypto
  2. import (
  3. "encoding/hex"
  4. "github.com/stretchr/testify/require"
  5. "testing"
  6. )
  7. func TestScrypt(t *testing.T) {
  8. key := Scrypt("hello world")
  9. t.Log(hex.EncodeToString(key))
  10. ok, err := VerifyScrypt("hello world", key)
  11. if err != nil {
  12. t.Fatal(err)
  13. }
  14. require.True(t, ok)
  15. }