private final static long from64(byte[] encoded, int idx, int size) {
		long res=0;
		int f=0;
		while(size>0) {
			size--;
			long r=0;
			// convert encoded[idx] back into a 6-bit value.
			byte d=encoded[idx++];
			if(d=='/') {
				r=1;
			}
			if(d>='0' && d<='9') {
				r=2+d-'0';
			}
			if(d>='A' && d<='Z') {
				r=12+d-'A';
			}
			if(d>='a' && d<='z') {
				r=38+d-'a';
			}
			res=res+((long)r << f);
			f+=6;
		}
		return res;
	}