how to convert mpz_t to a char variable

Marco Bodrato bodrato at mail.dm.unipi.it
Thu Jun 24 14:33:06 UTC 2021


Ciao,

Il Gio, 24 Giugno 2021 10:08 am, Ivan Döbeli ha scritto:
> how can i convert a mpz_t 16base variable to a char variable to create
> the sha256 checksum of it (i wan't to use

> mpz_set_str(n,"14f8da6389f9c2dd692ddc10aec26db4498f6a787682dd63af59f73e86399923",
> 16);

Ypu used mpz_set_str to set the value, you can use mpz_get_str if you want
something comparable (a string of printable digits from a base you
choose).

Otherwise, in another very recent thread Torbjörn Granlund suggested
mpz_export:
https://gmplib.org/list-archives/gmp-discuss/2021-June/006690.html

Ĝis,
m

-- 
http://bodrato.it/papers/



More information about the gmp-discuss mailing list