| 49 | return StringPiece(*dst); |
| 50 | } |
| 51 | static string RandomKey(random::SimplePhilox* rnd, int len) { |
| 52 | // Make sure to generate a wide variety of characters so we |
| 53 | // test the boundary conditions for short-key optimizations. |
| 54 | static const char kTestChars[] = {'\0', '\1', 'a', 'b', 'c', |
| 55 | 'd', 'e', '\xfd', '\xfe', '\xff'}; |
| 56 | string result; |
| 57 | for (int i = 0; i < len; i++) { |
| 58 | result += kTestChars[rnd->Uniform(sizeof(kTestChars))]; |
| 59 | } |
| 60 | return result; |
| 61 | } |
| 62 | static StringPiece CompressibleString(random::SimplePhilox* rnd, |
| 63 | double compressed_fraction, size_t len, |
| 64 | string* dst) { |