i2osp converts a positive integer into a byte string.
The first byte is MSB (most significant byte); the last byte is the LSB (least significant byte)
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulecrypton-1.0.4Haskell2010
Fast serialization primitives for integer
i2osp converts a positive integer into a byte string.
The first byte is MSB (most significant byte); the last byte is the LSB (least significant byte)
os2ip converts a byte string into a positive integer.
Just like i2ospOf except that it doesn't expect a failure: i.e. an integer larger than the number of output bytes requested.
For example if you just took a modulo of the number that represent the size (example the RSA modulo n).