MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / authKey

Function authKey

auth/password_hash.go:32–38  ·  view source on GitHub ↗

authKey returns the bcrypt hash + SHA1 digest of the password.

(hash []byte, password []byte)

Source from the content-addressed store, hash-verified

30
31// authKey returns the bcrypt hash + SHA1 digest of the password.
32func authKey(hash []byte, password []byte) (key string) {
33 s := sha1.New()
34 s.Write(password)
35 digest := string(s.Sum(nil))
36 key = digest + string(hash)
37 return key
38}
39
40// compareHashAndPassword is an optimized wrapper around bcrypt.CompareHashAndPassword that
41// caches successful results in memory to avoid the _very_ high overhead of calling bcrypt.

Callers 2

generateTestDataFunction · 0.85
compareHashAndPasswordFunction · 0.85

Calls 1

WriteMethod · 0.45

Tested by 1

generateTestDataFunction · 0.68