Help converting sha256 to 32-bit stream I need some help with hash value calculation.
 I am a bit confused by this statement that I found on w3 website on calculation of a DigestValue for xmldsig ( http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sha256 ):


  A SHA-256 digest is a 256-bit string. The content of the DigestValue
  element shall be the base64 encoding of this bit string viewed as a
  32-octet octet stream.


Does that mean that the sha256 hash value has to be converted to a 32-bit string before encoding it to base64?
If yes, could someone please tell me how this can be done? I'm a kind of a n00b, but I haven't found info on how to do that on the internet.
No, you don't have to convert to a 32-bit string.

A "32-octet octet stream" means an octet stream with a length of 32 octets. An octet stream is also known as a byte array. In older times bytes could have different lengths (7 or 9 byte lengths have existed). An octet is always 8 bits; nowadays octets and bytes should be considered synonyms.

So basically they are saying: treat the bit string as a stream of octets of the same length (as $32*8=256$), then base-64 encode it. Now most crypto libraries already treats the output of SHA-256 as byte array (octet stream). So you just are left with encoding the output to base 64.

One small warning: some crypto libraries already contain encoding internally. You will need to explicitly choose raw byte output for those libraries, unless you can specify base64, of course.