File: bin2hex.c

package info (click to toggle)
infnoise 0.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 27,304 kB
  • sloc: ansic: 2,177; sh: 251; python: 146; makefile: 65
file content (15 lines) | stat: -rw-r--r-- 269 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

int main() {
    int value = getchar();
    int count = 0;
    while(value != EOF) {
        printf("%02x", value);
        value = getchar();
        if(++count == 64) {
            putchar('\n');
        }
    }
    putchar('\n');
    return 0;
}