hexDigit returns a single lowercase hexadecimal digit byte.
(r *rand.Rand)
| 483 | |
| 484 | // hexDigit returns a single lowercase hexadecimal digit byte. |
| 485 | func hexDigit(r *rand.Rand) byte { |
| 486 | d := r.Intn(16) |
| 487 | if d < 10 { |
| 488 | return byte('0' + d) |
| 489 | } |
| 490 | return byte('a' + d - 10) |
| 491 | } |
| 492 | |
| 493 | // hexChars is the lowercase hex alphabet used by appendUnicodeEscape. |
| 494 | const hexChars = "0123456789abcdef" |