MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Hash

Function Hash

pkg/auth/password.go:66–72  ·  view source on GitHub ↗

Hash hashes a plaintext secret.

(ctx context.Context, plain string)

Source from the content-addressed store, hash-verified

64
65// Hash hashes a plaintext secret.
66func Hash(ctx context.Context, plain string) (string, error) {
67 str, err := HashValidatorFromContext(ctx).Hash(plain)
68 if err != nil {
69 return "", err
70 }
71 return str, nil
72}
73
74var errInvalidHash = errors.DefineInternal(
75 "invalid_hash",

Callers 15

SaveAccessMethod · 0.92
initFunction · 0.92
createUserMethod · 0.92
updateUserMethod · 0.92
updateUserPasswordMethod · 0.92
createClientMethod · 0.92
GenerateAPIKeyFunction · 0.92
TestEntityAccessFunction · 0.92
NewAPIKeyMethod · 0.92
NewUserSessionMethod · 0.92
PopulateMethod · 0.92

Calls 2

HashValidatorFromContextFunction · 0.85
HashMethod · 0.65

Tested by 4

initFunction · 0.74
TestEntityAccessFunction · 0.74
initFunction · 0.74
TestHashFunction · 0.68