From: "Aaron D. Gifford" Date: 2012-04-28T08:02:10+09:00 Subject: Re: why does this return 255 bits instead of 256 (and general bit byte hex string array crypt mayhem Remember, when you convert an integer to a string (#to_s) that leading zeros are trimmed off. So if a 256-bit hash happens to be an integer that, when converted to a binary string representation, that string may be from 1 to 256. If the hash was the integer zero (possible, though unlikely), the length would be 1. That may explain your results IF your hash input to SHA-256 was something other than "anything" (which hash, since the the highest bit at position 256 is a one, should produce a length of 256 when #to_s(2) is called). Aaron out.