BenchmarkRedactCall_HashMarkers calls .Redact() on a string with ‹†...› hash markers and hashing enabled. This exercises the SHA-256 path.
(b *testing.B)
| 38 | // BenchmarkRedactCall_HashMarkers calls .Redact() on a string with ‹†...› |
| 39 | // hash markers and hashing enabled. This exercises the SHA-256 path. |
| 40 | func BenchmarkRedactCall_HashEnabled(b *testing.B) { |
| 41 | EnableHashing(nil) |
| 42 | defer DisableHashing() |
| 43 | s := Sprintf("user=%s action=%s", HashString("alice"), SafeString("login")) |
| 44 | b.ResetTimer() |
| 45 | for i := 0; i < b.N; i++ { |
| 46 | _ = s.Redact() |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // BenchmarkRedactCall_SingleHashWithSalt — 1 ‹†alice› marker, HMAC-SHA256. |
| 51 | func BenchmarkRedactCall_HashWithSalt(b *testing.B) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…