go uses 'zig-zag' encoding, perhaps that is the difference?

On Wed, Feb 26, 2014 at 6:52 AM, Peter Lin <wool...@gmail.com> wrote:

>
> You may need to bit shift if that is the case
>
> Sent from my iPhone
>
> > On Feb 26, 2014, at 2:53 AM, Ben Hood <0x6e6...@gmail.com> wrote:
> >
> > Hey Colin,
> >
> >> On Tue, Feb 25, 2014 at 10:26 PM, Colin Blower <cblo...@barracuda.com>
> wrote:
> >> It looks like you are trying to implement the Decimal type. You might
> want
> >> to start with implementing the Integer type. The Decimal type follows
> pretty
> >> easily from the Integer type.
> >>
> >> For example:
> >> i = unmarchalInteger(data[4:])
> >> s = decInt(data[0:4])
> >> out = inf.newDec(i, s)
> >
> > Thanks for the suggestion.
> >
> > This is pretty much what I've got already. I think the issue might be
> > to do with the way that big.Int doesn't appear to use two's complement
> > to encode the varint. Maybe what is happening is that the encoding is
> > isomorphic across say Java, .NET, Python and Ruby, but that the
> > big.Int library in Go is not encoding in the same way.
> >
> > Cheers,
> >
> > Ben
>

Reply via email to