(h hash.Hash, out []byte, i int)
| 58 | } |
| 59 | |
| 60 | func sha256Key(h hash.Hash, out []byte, i int) []byte { |
| 61 | var num [8]byte |
| 62 | |
| 63 | // generate key=sha256(i) without allocations. |
| 64 | h.Reset() |
| 65 | binary.LittleEndian.PutUint64(num[:], uint64(i)) |
| 66 | h.Write(num[:]) |
| 67 | |
| 68 | s := h.Sum(out) |
| 69 | |
| 70 | return s |
| 71 | } |
| 72 | |
| 73 | func BenchmarkMap_NoValue(b *testing.B) { |
| 74 | ctx := testlogging.Context(b) |
no test coverage detected