Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cs/serialization): Improve precision in date serialization #344

Merged
merged 4 commits into from
Aug 9, 2024

Commits on Aug 9, 2024

  1. fix(cs/serialization): Improve precision in date serialization

    - Modify `BebopWriter.WriteDate` method to use a more precise algorithm
    - Introduce constants for ticks between epochs and date mask
    - Update date conversion to use milliseconds since Unix epoch
    - Apply bitmask to ensure consistent 64-bit representation
    
    This change should resolve hash discrepancies caused by date fields when serializing and deserializing objects.
    
    Testing:
    - Verified consistent hashing of original and round-tripped data
    - Ensured compatibility with existing implementations
    andrewmd5 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    ec6e32c View commit details
    Browse the repository at this point in the history
  2. fix(cs/deserialization): Align date deserialization with other implem…

    …entations
    
    This commit modifies the date deserialization process in Bebop to ensure
    consistency with the other implementations and corrects a type mismatch
    issue. This change complements the previous fix for date serialization,
    providing a complete and correct solution for date handling across languages.
    
    - Modify `BebopReader.ReadDate()` method to use a more precise algorithm
    - Introduce constants for ticks between epochs and date mask
    - Update date conversion to use milliseconds since Unix epoch
    - Ensure UTC DateTime is always returned
    - Fix type mismatch between ulong and long in date calculation
    - Use unchecked conversion to handle potential overflow
    
    This change resolves inconsistencies in date representation when
    deserializing data.
    andrewmd5 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    7a2de39 View commit details
    Browse the repository at this point in the history
  3. Revert "fix(cs/deserialization): Align date deserialization with othe…

    …r implementations"
    
    This reverts commit 7a2de39.
    andrewmd5 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    4e6426f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dde054a View commit details
    Browse the repository at this point in the history