title: Code golf - hex to (raw) binary conversion
body: <p>In response to <a href="https://stackoverflow.com/questions/794902/whats-the-opposite-of-od1">this question</a> asking about hex to (raw) binary conversion, a comment suggested that it could be solved in "5-10 lines of C, or any other language."</p>
  
  <p>I'm sure that for (some) scripting languages that could be achieved, and would like to see how.  Can we prove that comment true, for C, too?</p>
  
  <p>NB: this doesn't mean hex to <em>ASCII</em> binary - specifically the output should be a raw octet stream corresponding to the input ASCII hex.  Also, the input parser should skip/ignore white space.</p>
  
  <p><strong>edit</strong> (by Brian Campbell) May I propose the following rules, for consistency? Feel free to edit or delete these if you don't think these are helpful, but I think that since there has been some discussion of how certain cases should work, some clarification would be helpful.</p>
  
  <ol>
  <li>The program must read from stdin and write to stdout (we could also allow reading from and writing to files passed in on the command line, but I can't imagine that would be shorter in any language than stdin and stdout)</li>
  <li>The program must use only packages included with your base, standard language distribution. In the case of C/C++, this means their respective standard libraries, and not POSIX.</li>
  <li>The program must compile or run without any special options passed to the compiler or interpreter (so, 'gcc myprog.c' or 'python myprog.py' or 'ruby myprog.rb' are OK, while 'ruby -rscanf myprog.rb' is not allowed; requiring/importing modules counts against your character count).</li>
  <li>The program should read integer bytes represented by pairs of adjacent hexadecimal digits (upper, lower, or mixed case), optionally separated by whitespace, and write the corresponding bytes to output. Each pair of hexadecimal digits is written with most significant nibble first.</li>
  <li>The behavior of the program on invalid input (characters besides <code>[a-fA-F \t\r\n]</code>, spaces separating the two characters in an individual byte, an odd number of hex digits in the input) is undefined; any behavior (other than actively damaging the user's computer or something) on bad input is acceptable (throwing an error, stopping output, ignoring bad characters, treating a single character as the value of one byte, are all OK)</li>
  <li>The program may write no additional bytes to output.</li>
  <li>Code is scored by fewest total bytes in the source file. (Or, if we wanted to be more true to the original challenge, the score would be based on lowest number of lines of code; I would impose an 80 character limit per line in that case, since otherwise you'd get a bunch of ties for 1 line).</li>
  </ol>