You can use String # unpack . The argument indicates the type of conversion. "N"used below and means "32-bit unsigned, network (byte) byte order". See Link for all parameters.
"\x00\x00\x00\x01".unpack("N")
"\x00\x00\x00\xFF".unpack("N")
, Array, [0] .first, Fixnum.
Array # :
Array # pack
bytes.pack('L>*')
bytes.pack('l>*')
, N, " "
bytes.pack('N*')