-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Description
Hello,
I would like to rebuild a network protocol. The reference implementation is written in Go. The following MsgPack structure is available there:
type handshakeStruct struct {
Type uint8 `msgpack:"Y"` // MUST be 'h' for a handshake
Magic uint16 `msgpack:"M"`
Version uint16 `msgpack:"V"`
Session uint32 `msgpack:"S"`
}
Now I wanted to rebuild this in Ruby, but the length of the field "V" is different. I think this is because the version number 3 is treated as uint8 in Ruby and as uint16 in Go. How can I produce the same result in Ruby as in Go?
{
'Y' => 'h',
'M' => 11181,
'V' => 3,
'S' => @session_id
}.to_msgpack
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels