fork(1) download
  1. #include <stdlib.h>
  2. #include <assert.h>
  3. #include <stdio.h>
  4.  
  5. char translate (unsigned char ch);
  6.  
  7. int main (void)
  8. {
  9. unsigned char hash[] = { 0xD, 0xC, 0xB, 0x7, 0x4, 0x8, 0xA, 0x5,
  10. 0xB, 0xC, 0x5, 0x3, 0x9, 0x0, 0xF, 0x2 };
  11. char str[80];
  12. int i;
  13.  
  14. for (i = 0; i < sizeof (hash); i++)
  15. str[i] = translate (hash[i]);
  16.  
  17. str[i] = '\0';
  18.  
  19. puts (str);
  20.  
  21. return EXIT_SUCCESS;
  22. }
  23.  
  24. char translate (unsigned char ch)
  25. {
  26. assert (0 <= ch && ch <= 0xF);
  27.  
  28. const char * dict = "0123456789ABCDEF";
  29. return dict[ch];
  30. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
DCB748A5BC5390F2