Skip to content

Cannot decode large signed Int64 #5

@DrewMcArthur

Description

@DrewMcArthur

from testCases.bal:67

// saving this test case for later: encoding works, 
// but currently trying to run decode([0xd3, ...]) will fail, 
// because 0xd3 == signed Int64, and our algorithm fails.
// this is because we calculat an int, then subtract (1 << 8*nBytes), and 
// if nBytes == 8, we would try to 1 << 64, which doesn't work with 64-bit ints.
TestCase[] SignedInt64TestCase = [
    {"input": -11111111111, "output": [0xd3, 0xff, 0xff, 0xff, 0xfd, 0x69, 0xb9, 0xe6, 0x39]}
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions