thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

Fix negative long number encoding #155

Closed kriskowal closed 6 years ago

kriskowal commented 6 years ago

Previously, when encoding a plain JavaScript Number for a i64 with the (js.type = 'Long') annotation, the high four bits would be masked out to zero, resulting in a large 32 bit integer. This change runs the number through the Long library to ensure that the high bits are all set for negative numbers less than 32 bits wide.

r @jakemh

andrewdeandrade commented 6 years ago

LGTM

jakemh commented 6 years ago

LGTM

hparra commented 6 years ago

Nice @jakemh