Decoding Base 36 numbers in C

typedef char string6[7];

char* IDToStr(unsigned long ID, string6 Str)
{
  int imed;
  int i;

  Str[6] = 0;
  for (i=5; i>=0; i--) {
    imed = ID % 36;
    if (imed > 9)
      imed += 7;
    Str[i] = imed + '0';
    ID /= 36;
  }
  return(Str);
}