History.

I don't think your code is standard though, usually void are implicit in the 
return type, also `var` are used for in-place mutation, not pointers. And it's 
probably much more likely to read from an immutable value (often an int or byte 
array) to a mutable value (often a byte array or an int).

Also your library doesn't abstract away "readBytesBE"/"writeBytesBE" which 
would autoswap on little-endian architecture or be a no-op on big-endian, and 
equivalent for little-endian operations.

`hton` , `ntoh` are inheriting bad unix naming in my opinion.

For working with endianness this has a better explicit and generic API, and is 
heavily tested in non-trivial projects including networking, big integers and 
cryptography: 
[https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim](https://github.com/status-im/nim-stew/blob/master/stew/endians2.nim)

Reply via email to