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

Add Float#pack_float32 and Float#pack_float64 methods #431

Open
6 tasks
postmodern opened this issue May 30, 2023 · 1 comment
Open
6 tasks

Add Float#pack_float32 and Float#pack_float64 methods #431

postmodern opened this issue May 30, 2023 · 1 comment
Labels
binary Binary data core_ext Core Extension feature New Feature help-wanted Extra attention is needed

Comments

@postmodern
Copy link
Member

postmodern commented May 30, 2023

Add methods for easily packing a Float into a float32 or float64 C type. These methods should call pack with the C type and **kwargs.

  • Float#pack_float32
  • Float#pack_float64

The following methods should not be passed **kwargs as they are tied to little-endian or big-endian:

  • Float#pack_float32_le
  • Float#pack_float64_le
  • Float#pack_float32_be
  • Float#pack_float64_be

Alias the *_be to *_ne or *_net?

The documentation and specs can be copied from Float#pack.

@postmodern postmodern added binary Binary data core_ext Core Extension feature New Feature labels May 30, 2023
@postmodern postmodern added this to the 1.1.0 milestone May 30, 2023
@postmodern
Copy link
Member Author

Did a Mastodon poll about _ne vs. _net suffix, and appears most people say to just use _be when referring to network-byte-order types. So maybe hold off on the _ne/_net aliases until someone eventually requests them?
https://infosec.exchange/@postmodern/110459088606261323

@postmodern postmodern added the help-wanted Extra attention is needed label Sep 4, 2023
@postmodern postmodern removed this from the 1.1.0 milestone Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary Binary data core_ext Core Extension feature New Feature help-wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant