Example #1
0
        public static int[] DecodeIntDiff(string text)
        {
            CharFlow flow = new CharFlow(text.ToCharArray());
            int      sz   = Base46.DecodeUnsigned(flow);

            int[] data = new int[sz];
            int   last = 0;

            for (int i = 0; i < sz; i++)
            {
                last   += Base46.Decode(flow);
                data[i] = last;
            }
            return(data);
        }
Example #2
0
        public static int[] DecodeIntPairsDiff(string text)
        {
            CharFlow flow = new CharFlow(text.ToCharArray());
            int      sz   = Base46.DecodeUnsigned(flow);

            int[] data      = new int[sz * 2];
            int   j         = 0;
            int   lastKey   = 0;
            int   lastValue = 0;

            for (int i = 0; i < sz; i++)
            {
                lastKey   += Base46.Decode(flow);
                lastValue += Base46.Decode(flow);
                data[j++]  = lastKey;
                data[j++]  = lastValue;
            }
            return(data);
        }