Do you want to pack four bytes into a single 4-byte value? One way to do
that is like this:

(UInt32(a) << 24) | (UInt32(b) << 16) | (UInt32(c) << 8) | UInt32(d)

[Aside: when you say variable, I think you mean value.]

On Fri, Mar 27, 2015 at 9:04 PM, J Luis <[email protected]> wrote:

> Hi,
>
> How can I encode  4 one byte variable, lets say
>
> julia> UInt8[1 2 5 255]
> 1x4 Array{UInt8,2}:
>  0x01  0x02  0x05  0xff
>
> into a single variable with 4 bytes length?
>
> Thanks.
>

Reply via email to