Couldn't this be written deterministically?

```
let number_of_valid_characters = N;
let mut val = rng.gen_uint_range(0, number_of_valid_characters);
if val > surrogate_threshold {
  val += number_of_surrogates;
}
return char::from_u32(val).unwrap()
```