Converting an mpz_t to a byte array

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Tue Apr 3 07:54:45 CEST 2012


Ciao!

Il Lun, 2 Aprile 2012 7:24 pm, Matt Cheung ha scritto:
> Is there a way to convert an mpz_t to a byte array?  I'm wondering

Yes!

> because if I want to use gmp to communicate values over a network I want
> to send it as a byte array.

I suggest you mpz_export, documented in the manual:

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

Regards,
m

-- 
http://bodrato.it/



More information about the gmp-discuss mailing list