Skip to content

Fun & Games With Endianness #2

Closed
@Julian

Description

@Julian

Hello!

I'm unfortunately not quite sure where this bug belongs, because I don't know the details of the spec used to encode HDRHistograms, but someone's got some little endian in my big endian :) -- if this belongs in the other repo, lemme know.

The following is a trivial HDRHistogram encoded via HdrHistogram/HdrHistogram_Py (via from hdrh.histogram import HdrHistogram; print HdrHistogram(1, 2, 3).encode():

FJOEHBgAAAB4nBOe3CLDAAXMQMwIZTNBaRgfADG9AU4=

But decoding that with HdrHistogramJS raises an error saying that only V2 encoding is supported. Reading the code in HdrHistogram_Py shows it's definitely trying to do V2, whatever that is, and stepping through HdrHistogramJS' code, it's pretty clear that's what happening is that it's interpreting the byte buffer as big endian, but HdrHistogram_Py's output is little endian, so it blows up calculating even just the histogram's header.

Who's right :)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions