1

In GMP extension in PHP it is possible to convert a large number to string. For example:

gmp_strval("1234999999999999999999999999999999213123123999999", 36);

gives:

p9owzsy9oqh5k9wdw0ve3si9futy5fj

Question: how to perform inverse transformation - make 1234999999999999999999999999999999213123123999999 out of p9owzsy9oqh5k9wdw0ve3si9futy5fj ?

Thank you.

1 Answer 1

2

The gmp_init() function takes an optional base argument.

gmp_init('p9owzsy9oqh5k9wdw0ve3si9futy5fj', 36)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.