How do I do if I want to pack small uint32 values?
dictav opened this issue · comments
Shintaro Abe commented
Hi,
I'm trying implement MessagePack-RPC using this library. And I need to pack a value of uint32.
I have tryed,
let value = MessagePackValue(1 as UInt32)
let data = MessagePack.pack(value) //=> 0x01
But I got a fixnum instead of uint32.
How do I do if I want to pack small uint32 values?
Alex Akers commented
Currently MessagePack.swift packs integers into as few bytes as possible. I would resist changing this because, instead of .Int
and .UInt
cases, there would need to be separate cases for each integral width (8, 16, 32, 64).