secure hash in c#

  • Thread starter Thread starter RR
  • Start date Start date
R

RR

Hello I am trying to send an object over the network. However I want to be
able to sign the object. I looked at the sha hash function provided and it
takes in a byte array. I thought of converting the object into a stream
using binary formatter, then converting the stream into a byte array and
feeding it to the sha function. Is there an easier way to do this? For
example just converting directly to a byte array? Thanks for your help

-RR
 
RR said:
Hello I am trying to send an object over the network. However I want to be
able to sign the object. I looked at the sha hash function provided and it
takes in a byte array. I thought of converting the object into a stream
using binary formatter, then converting the stream into a byte array and
feeding it to the sha function. Is there an easier way to do this? For
example just converting directly to a byte array? Thanks for your help

Well, formatting it to a MemoryStream and then calling
MemoryStream.ToArray will get you the byte array pretty quickly...
 
Back
Top