I made my own... heres some advice...
If you use a system of 62 characters (0-9, a-z, A-Z) you can fit any number up to 61 in one spot of the code (1 character). If the max level is 20 or 50 you could use this method. If you need to store more, You can use a 2-digit system as I did, where you can store up to about 2500 (despite the fact that it should be 3721 mathematically, war3 doesn't want to let me loop 3,721 times... only 2500). and for storing gold which was supposed to be a number up to 1 million (max gold) i wanted to make a 3-digit system but I ran into the problem of only being able to loop around 2500 times... so I stored by using 2 2-digit parts (4 characters in the code) and it stored by splitting the gold amount into 2 parts. (not dividing the gold amount by 2 but the length of the gold string) so if you had 999,999 gold, it stores 999 in the first 2-digit and 999 in the second 2-digit and the loading code restores it like that
but theres many ways to do it... you could do it w/o any looping if you wanted I guess