MCPcopy Create free account
hub / github.com/cockroachdb/redact / BenchmarkRedactCall_HashWithSalt

Function BenchmarkRedactCall_HashWithSalt

bench_test.go:51–59  ·  view source on GitHub ↗

BenchmarkRedactCall_SingleHashWithSalt — 1 ‹†alice› marker, HMAC-SHA256.

(b *testing.B)

Source from the content-addressed store, hash-verified

49
50// BenchmarkRedactCall_SingleHashWithSalt — 1 ‹†alice› marker, HMAC-SHA256.
51func BenchmarkRedactCall_HashWithSalt(b *testing.B) {
52 EnableHashing([]byte("my-secret-salt"))
53 defer DisableHashing()
54 s := Sprintf("user=%s action=%s", HashString("alice"), Safe("login"))
55 b.ResetTimer()
56 for i := 0; i < b.N; i++ {
57 _ = s.Redact()
58 }
59}
60

Callers

nothing calls this directly

Calls 6

HashStringTypeAlias · 0.85
EnableHashingFunction · 0.70
DisableHashingFunction · 0.70
SprintfFunction · 0.70
SafeFunction · 0.70
RedactMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…