Skip to content

What is needed to get this proposal moving? #22

Open
@WORMSS

Description

@WORMSS

What is needed to get this moving?

I have not been able to find a working polyfill to have a base36 BigInt.. (That doesn't break on the input 10 which should be 36, but all the ones I found come out as 1)
Having something such as BigInt.fromString(input, 36) would help me greatly..

I have a string containing 58000+ 0 and 1
Which I have to manipulate with

const bigNum = BigInt(`0b${binStr}`); // Have to add 0b so BigInt knows its base2
const hexStr = bigNum.toString(16); // resulting in a 14000 character string;
/* this hex string gets transmitted over the network */
/* then on the otherside */
const bigNum = BigInt(`0x${hexStr}`); // Have to add 0x so BigInt knows its base16
const binStr = bigNum.toString(2); // Returns to the original binStr format.

It would be nice to do

const bigNum = BigInt.fromString(binStr, 2); // No dodgy 0b mess
const zStr = bigNum.toString(36); // resulting in a 10000 character string; (Saving 4000 chars)
/* this base36 string gets transmitted over the network */
/* then on the otherside */
const bigNum = BigInt.fromString(zStr, 36); // No dodgy 0z mess (since it doesn't exist, no way to specify its a base36 BigInt(input)
const binStr = bigNum.toString(2); // Returns to the original binStr format.

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