github.com/MetalBlockchain/metalgo@v1.11.9/utils/password/hash_test.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package password
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func TestHash(t *testing.T) {
    13  	require := require.New(t)
    14  
    15  	h := Hash{}
    16  	require.NoError(h.Set("heytherepal"))
    17  	require.True(h.Check("heytherepal"))
    18  	require.False(h.Check("heytherepal!"))
    19  	require.False(h.Check(""))
    20  }