number_to_bytes(n), bytes_to_number(b)

I suspect the endianness is wrong.

@wolever, what do you think?