Fixed an error in the commnent's sample
Should only allocate when the contract is used
Simply use ulong right now to keep things simple
Rearranged the algorithm to convert a number string to packed binary