libtom/libtommath — pull request #9 by ccbrown (2013-01-22 20:51:45+00:00)
Title: mp_import / mp_export à la GMP's mpz_import / mpz_export

Often we need to serialize or deserialize large numbers, for example to store or read them from files or send them over a network. We don't often have control over the format that these numbers need to be stored or transferred in, and tommath's read and write functions are pretty limited in what they can do.

This patch adds two new functions: mp_import and mp_export, which are based on GMP's powerful mpz_import and mpz_export functions:

http://gmplib.org/manual/Integer-Import-and-Export.html

These functions can import and export integers according to the format specified by its arguments, which can adhere to virtually any common specification.