Skip to content

Faster toString('hex') implementation #364

Description

@jawj

In a similar vein to #245, I have an implementation of toString('hex') that's between 2x and 4x faster than the existing one, depending on the browser/engine.

See: https://jsbench.me/evm3ejel2i/3

Possible drawbacks of this implementation:

  • Requires TextDecoder (does this package support IE currently?)
  • Likely uses more memory, since it allocates a Uint16Array to hold intermediate data

Would you accept a PR to switch to this implementation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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