title: Implementing MD5: Inconsistent endianness?
body: <p>So I tried implementing the MD5 algorithm according to <a href="https://www.ietf.org/rfc/rfc1321.txt" rel="nofollow noreferrer">RFC1321</a> in C# and it works, but there is one thing about the way the padding is performed that I don't understand, here's an example:</p>
  
  <p>If I want to hash the string "1" (without the quotation marks) this results in the following bit representation: <strong>10001100</strong></p>
  
  <p>The next step is appending a single "1"-Bit, represented by <strong>00000001</strong> (big endian), which is followed by "0"-Bits, followed by a 64-bit representation of the length of the original message (low-order word first).</p>
  
  <p>Since the length of the original message is 8 (Bits) I expected 0000000000000000000000000000<strong>1</strong>000 00000000000000000000000000000000 to be appended (low-order word first). However this does not result in the correct hash value, but appending 000<strong>1</strong>0000000000000000000000000000 00000000000000000000000000000000 does.</p>
  
  <p>This looks as if suddenly the little-endian format is being used, but that does not really seem to make any sense at all, so I guess there must be something else that I am missing?</p>