[RESOLVED] Express big integers into smallest possible values
I´d like to ask you if there´s the simplest way how to express big integers into smaller values. for example: 445222542222100000222333333225554 Maybe with factorization?
Thanks a lot.
VB.NET Developer
Re: Express big integers into smallest possible values
The numbers you are showing are in base 10 I assume. If you change to base 16 the same number would take less characters to express. If you changed to a higher base (say base 26) you could express the same value with even less characters. You could then extend that to base 256 which would compress the value significantly. Essentially each character in the displayed value would actually be a value from 0-255.
For example the base 10 value = "t4~" would be
(ASC("t") * 265^2) + (ASC("4") * 256) + ASC("~") = (116 * 256^2) + (52 * 256) + 126 = 7,615,614
Of course if you need all of the values to be visible you would need to get tricky and use base 95 with a 32 offset so your characters would be ascii values 32-127.
If you went this route, you would probably want to write you own random generator that wraps the Random class.
Re: Express big integers into smallest possible values
Quote:
Of course if you need all of the values to be visible
No, I dont need that.
Thanks. My problem is sloved now.
VB.NET Developer