MCPcopy
hub / github.com/smallstep/cli / CompareString

Function CompareString

internal/kdf/kdf.go:135–137  ·  view source on GitHub ↗

CompareString compares the given password with the given PHC encoded hash, returns true if they match. The time taken is a function of the length of the slices and is independent of the contents.

(password, phc string)

Source from the content-addressed store, hash-verified

133// returns true if they match. The time taken is a function of the length of
134// the slices and is independent of the contents.
135func CompareString(password, phc string) (bool, error) {
136 return Compare([]byte(password), []byte(phc))
137}

Callers 3

TestKDFFunction · 0.85
TestCompareFunction · 0.85
TestVectorsFunction · 0.85

Calls 1

CompareFunction · 0.85

Tested by 3

TestKDFFunction · 0.68
TestCompareFunction · 0.68
TestVectorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…