let byte_of_int32 i =
let one_byte = Int32.of_int 0xFF
in
let extract_byte sb =
let mask =
Int32.shift_left one_byte ( sb * 8 )
in
let i_masked =
Int32.logand i mask
in
Int32.to_int (Int32.shift_right i_masked ( sb * 8 ))
in
( extract_byte 3, extract_byte 2, extract_byte 1, extract_byte 0 )