User Tag List

Results 1 to 5 of 5

Thread: Binary object - Hex encode

  1. #1
    Forum Moderator Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Binary object - Hex encode

    How do i encode to hex using the binary object without causing it to crash? It happens when i use a value outside of 0-255. But the binary object works with signed bytes, so a value from -128 to -1 causes it to crash as i try to encode-to-hex...

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on
    LIJI's Avatar
    Join Date
    Jun 2006
    Location
    Israel
    Posts
    1,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary object - Hex encode

    Just add 128 to convert Signed to Unsigned.
    Or use ByteArray, that was made for this propose

  3. #3
    Forum Moderator Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary object - Hex encode

    but you can't add 128 to a byte that will take the byte value over 127, and therefore loop around to a negative value, and then will cause a crash in mmf when you encode-to-hex.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on
    LIJI's Avatar
    Join Date
    Jun 2006
    Location
    Israel
    Posts
    1,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary object - Hex encode

    No, When you write to byte do:
    MyByte-128
    And to read the byte do:
    GetByte("Binary",BytePosition)+128
    That solves the problem with the binary object.
    ByteArray is unsigned anyway.

  5. #5
    Forum Moderator Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Binary object - Hex encode

    LIJI, you had it right the first time :P.
    The point is, that the Encode-to-Hex function thinks the binary object works with 0-255 bytes, and when it processes a byte below 0, then it crashes. So, since the binary object works with -128 to 127, then you can see i've gotta dissuse all the negative value bytes in order to make it work.
    I wanna store a hex string of bytes in a normal array, so your array is not applicable.

Similar Threads

  1. URL encode Problem
    By StingRay in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 7th October 2013, 10:49 AM
  2. Encode URL
    By kiko in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 22nd July 2013, 08:20 PM
  3. URL encode
    By ASD in forum Extension Development
    Replies: 0
    Last Post: 26th February 2011, 09:51 PM
  4. Binary object encode to hex crash
    By gamefreak202 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 4th July 2010, 02:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •