(h hash.Hash, out []byte, i int)
| 131 | } |
| 132 | |
| 133 | func sha256Key(h hash.Hash, out []byte, i int) []byte { |
| 134 | var num [8]byte |
| 135 | |
| 136 | // generate key=sha256(i) without allocations. |
| 137 | h.Reset() |
| 138 | binary.LittleEndian.PutUint64(num[:], uint64(i)) |
| 139 | h.Write(num[:]) |
| 140 | |
| 141 | s := h.Sum(out) |
| 142 | |
| 143 | return s |
| 144 | } |
| 145 | |
| 146 | func BenchmarkInternalMap_NoValue(b *testing.B) { |
| 147 | ctx := testlogging.Context(b) |
no test coverage detected