Endicon implements the codicon crate traits for doing endianness-based encoding and decoding on integers. See the documentation for full details.
codicon
Run this command:
$ cargo add endicon