Skip to content

Termination key for Pack in Swift 4 #67

Description

@nagarajaghantasala

IOS app is packing the data to send to Linux Device by this framework.

Linux Device is unpacking by mpack library.

When I used Message pack v1.2.0 for Swift 2, pack in IOS App and unpack in Linux Device are working.

After I upgrade the Message Pack v3.0 for Swift 4, Pack is not working fine.

  1. Termination key is not generated in Pack for Swift 4 and whereas that key is generating for Swift 2.
  2. One extra byte is adding to before string value after packing the data in Swift 2. This is not happening in Swift 4.
  3. Which means if we compared Swift 2 and Swift 4 Hexa values, one Byte difference is appearing in Pack. Because of this unpacking is not happening in Device side.

Example Data :-

I used same String in Array data for Message pack v1.2.0 and v3.0

Message pack v1.2.0

32 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdef

Hexa : 91d92061 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 646566

64 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdef
Hexa : 91d94061 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 64656661 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 646566

128 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdef
Hexa : 

91d98061 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 64656661 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 64656661 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 64656661 62636465 66676869 6a6b6c6d 6e6f7071 72737475 76777879 7a616263 646566

Message pack v3.0

32 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdef
Hexa : 916511d1 0380d103 800078aa 31313332 31323331 323391d9 61626364 65666768 696a6b6c 6d6e6f70 71727374 75767778 797a6162 63646566

64 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdef
Hexa : 91d96162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 65666162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 6566

128 Bytes :-
String : abcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdefabcdefghijklmnopqrstuvwxyzabcdef
Hexa : 91d96162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 65666162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 65666162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 65666162 63646566 6768696a 6b6c6d6e 6f707172 73747576 7778797a 61626364 6566

Please provide the solution for this issue.

Thanks in Advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions