From byte array to integer

Still got my C head on:

How in Ruby would I go about extracting a four byte integer from a byte
array?
Feel like I have gone back 10 years.

Thanks,
Jim.

Look into String#unpack (
http://ruby-doc.org/core/classes/String.html#M000728)

Cheers,


Avdi

Thanks that works great.

This forum is one of the best things about Ruby!

Thanks again,
Jim.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs