{"action":"opened","issue":{"url":"https://api.github.com/repos/google/brotli/issues/580","repository_url":"https://api.github.com/repos/google/brotli","labels_url":"https://api.github.com/repos/google/brotli/issues/580/labels{/name}","comments_url":"https://api.github.com/repos/google/brotli/issues/580/comments","events_url":"https://api.github.com/repos/google/brotli/issues/580/events","html_url":"https://github.com/google/brotli/issues/580","id":247409955,"number":580,"title":"Brotli compression ratio depends on endianness of CPU","user":{"login":"eustas","id":203457,"avatar_url":"https://avatars1.githubusercontent.com/u/203457?v=4","gravatar_id":"","url":"https://api.github.com/users/eustas","html_url":"https://github.com/eustas","followers_url":"https://api.github.com/users/eustas/followers","following_url":"https://api.github.com/users/eustas/following{/other_user}","gists_url":"https://api.github.com/users/eustas/gists{/gist_id}","starred_url":"https://api.github.com/users/eustas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eustas/subscriptions","organizations_url":"https://api.github.com/users/eustas/orgs","repos_url":"https://api.github.com/users/eustas/repos","events_url":"https://api.github.com/users/eustas/events{/privacy}","received_events_url":"https://api.github.com/users/eustas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-02T14:32:14Z","updated_at":"2017-08-02T14:32:14Z","closed_at":null,"body":"TL;DR: Just realized that \"unaligned load + mask\" technique used by some hashers will give endianness-inconsistent results.\r\n\r\nThis problem does not affect correctness, only what backward references selection and, consequently, compression ratio.\r\n\r\nLets say, hasher depends on `5` bytes of input. Then, it does the following: `hash = magic * (load64(src) & 0xFFFFFFFFFF)`. On little-endian CPU the first `5` bytes of `src` will affect the resulting hash. On big-endian CPU, the first `3` bytes will be ignored, and next `5` bytes will be taken into account. This way, on big-endian CPU, matches of length `[5..7]` are likely to be missed by hasher. On the other side there will be more `8+` matches."}}
{"actor":{"display_login":"eustas"}}