From: Mike Bethany Date: 2012-04-28T05:57:14+09:00 Subject: Re: why does this return 255 bits instead of 256 (and general bit byte hex string array crypt mayhem --14dae93403c53e765704beaf59e6 Content-Type: text/plain; charset=ISO-8859-1 You're asking for the length of two different things, one is an OpenSSL::Digest::SHA256 object the other is a 32 character long string. On Fri, Apr 27, 2012 at 4:36 PM, instance_variable ok wrote: > Sorry this was a mistake on my part, I meant this: > > hash = OpenSSL::Digest::SHA256.new > test_hash_value = hash << "anything" > puts test_hash_value.to_s.length > > if I don't convert .to_s I get 32 as the length > > I am on ubuntu > > -- > Posted via http://www.ruby-forum.com/. > > --14dae93403c53e765704beaf59e6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You're asking for the length of two different things, one is an OpenSSL= ::Digest::SHA256 object the other is a 32 character long string.

On Fri, Apr 27, 2012 at 4:36 PM, instance_variable = ok <lists@ruby-forum.com> wrote:
Sorry this was a mistake on my part, I meant= this:

hash =3D OpenSSL::Digest::SHA256.new
test_hash_value =3D hash << "anything"
puts test_hash_value.to_s.length

if I don't convert .to_s I get 32 as the length

I am on ubuntu

--14dae93403c53e765704beaf59e6--