about summary refs log tree commit diff
path: root/bitutil.c
blob: 8b2807f654c9336ba0dd9b42170123642b0a0dc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
char nibble_hex(short h) {
    switch(h) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
            return (h + 48);
        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
            return (h + 55);
        default:
            return 0;
    }
}