www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.bigint: BigInt conversion

reply "novice2" <sorry noem.ail> writes:
How i can convert ubyte[] to BigInt and BigInt to ubyte[] ?
Or uint[]...

For example, i need RSA crypto. I should get ubyte[] data, 
ubyte[] key, convert it to BigInt, calculate, then save result as 
ubyte[] data again.

But i see BigInt convertable to string only :(
Nov 25 2012
next sibling parent "Stian" <stian.pedersen gmail.com> writes:
On Sunday, 25 November 2012 at 21:36:38 UTC, novice2 wrote:
 How i can convert ubyte[] to BigInt and BigInt to ubyte[] ?
 Or uint[]...

 For example, i need RSA crypto. I should get ubyte[] data, 
 ubyte[] key, convert it to BigInt, calculate, then save result 
 as ubyte[] data again.

 But i see BigInt convertable to string only :(

If you look in https://github.com/apartridge/crypto you'll find both an altered BigInt and RSA skeleton. I think you'll find what you are looking for.
Nov 25 2012
prev sibling next sibling parent "novice2" <sorry noem.ail> writes:
Big thank you. I hope, this changes will be included in phobos in 
future.
Dec 03 2012
prev sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
novice2:

 I hope, this changes will be included in phobos in future.

Sometimes hoping isn't enough. If you have a need that youi think should be in Phobos, then I think you should ask for it in Bugzilla. Asking isn't equal to someone actually implementing it, but in this early stage of the life of Phobos knowing what's needed is a very interesting information. Bye, bearophile
Dec 03 2012