I am trying to find out how I can pack an integer or float value in to a byte array in Julia. In Python I would just do the following:
struct.pack("<q",1)
Which would give me '\x01\x00\x00\x00\x00\x00\x00\x00'
or for a float:
struct.pack("<f",0.1)
Is there any package in Julia that provides this?
Thanks!
See the StrPack package: https://strpackjl.readthedocs.org/en/latest/
This is actually one of the oldest Julia packages around.