package argon2_test import ( "testing" "euphoria-laxis.fr/go-packages/argon2/v1.1.0" ) var ( randomString, hashedString string opts []argon2.OptFunc ) func TestOptions(t *testing.T) { opts = []argon2.OptFunc{ argon2.SetMemory(32 * 1024), // 32 bits argon2.SetParallelism(4), // 4 concurrent actions argon2.SetKeyLength(32), // key length argon2.SetSaltLength(32), // salt length argon2.SetIterations(4), // 4 iterations, should be fast since there's 4 concurrent actions } } func TestEncoder(t *testing.T) { var err error e, _ := argon2.NewEncoder(opts...) randomString, err = e.RandomString(32) if err != nil { t.Fatal(err) } hashedString, err = e.HashString(randomString) if err != nil { t.Fatal(err) } }