You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NAIF provides the SPACIT utility that converts any platform-compatible DAF file into its "transfer format" equivalent. The user then needs to run the same SPACIT tool on the other platform to rebuild a DAF file there. For example, a user may run this tool on a little endian platform to build the transfer file, and then run SPACIT on the big endian machine to build a DAF encoded in big endian.
The underlying mechanism to read and write byte arrays in ANISE is the zerocopy crate. This crate supports byte ordering with the byteorder crate feature. Hence, it should be possible to read and write in both byte orders regardless of the platform byte ordering.
Note: this revives an idea that was planned in #2.
Requirements
Add an CLI option to convert to DAF for little endian into a DAF for big endian machines
If possible, support reading little and big endian DAF files directly in ANISE without conversion
Test plans
Build a big endian SPK from a little endian SPK, and convert back again, ensuring that the CRC32 match after the round trip conversion
If the second requirement is completed, test loading the big endian SPK on the little endian platform used by Github actions
Find a big endian machine and convert a public DAF file into big endian, checking that it matches the one converted by ANISE
High level description
NAIF provides the SPACIT utility that converts any platform-compatible DAF file into its "transfer format" equivalent. The user then needs to run the same SPACIT tool on the other platform to rebuild a DAF file there. For example, a user may run this tool on a little endian platform to build the transfer file, and then run SPACIT on the big endian machine to build a DAF encoded in big endian.
The underlying mechanism to read and write byte arrays in ANISE is the
zerocopy
crate. This crate supports byte ordering with thebyteorder
crate feature. Hence, it should be possible to read and write in both byte orders regardless of the platform byte ordering.Note: this revives an idea that was planned in #2.
Requirements
Test plans
Design
This should rely on https://docs.rs/zerocopy/latest/zerocopy/byteorder/index.html. One idea would be to parse the endian flag and set an enum in the DAF structure. Then use that enum to set the type of the byte ordering for the FileRecord and other structures where byte ordering matters, i.e. where there are integers (signed or not). Floating point values do not have any byte ordering issues thanks to the IEEE754 specification: https://doc.rust-lang.org/std/primitive.f64.html#method.from_bits.
The text was updated successfully, but these errors were encountered: