Get the value of a hex-digit.
(b []byte, i int)
| 66 | |
| 67 | // Get the value of a hex-digit. |
| 68 | func as_hex(b []byte, i int) int { |
| 69 | bi := b[i] |
| 70 | if bi >= 'A' && bi <= 'F' { |
| 71 | return int(bi) - 'A' + 10 |
| 72 | } |
| 73 | if bi >= 'a' && bi <= 'f' { |
| 74 | return int(bi) - 'a' + 10 |
| 75 | } |
| 76 | return int(bi) - '0' |
| 77 | } |
| 78 | |
| 79 | // Check if the character is ASCII. |
| 80 | func is_ascii(b []byte, i int) bool { |
no outgoing calls
no test coverage detected