Skip to content

Feature request: ToBig() version that's alloc free #176

@karalabe

Description

@karalabe

E.g. uint256.IntoBig(n *big.Int) that would essentially be the same as ToBig, just would use the provided sink instead of always allocating a new int. This could be needed for example in SSZ for encoding/decoding big.Int's going across uint256 for simplicity. Possibly I could manually roll big.Int without allocs too there, but it might be a good long term thing to have the conversion be alloc free.

The reason I suggested a new API is not to break ToBig, which is kind of useful in general, just not in alloc free cases.

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