Skip to content

BigInt support #4

Description

@4kimov

Right now max value is Number.MAX_SAFE_INTEGER, with no support for bigints. This is an issue for tracking this feature. Hashids has support for it here (for reference): https://github.com/niieani/hashids.js/blob/master/src/hashids.ts

Todos:

  • Support in encode()/decode()
  • Adjust maxValue()
  • Add tests specifically for bigints
  • Add an example of how to use bigints

Activity

  1. phillipb commented on Nov 25, 2023

    @phillipb

    +1 this is useful if you need to do something like convert a uuid to a sqid

  2. nathanclevenger commented on Jun 21, 2024

    @nathanclevenger

    +1 also required for Mongo Object IDs

  3. DaleLJefferson commented on Jun 13, 2025

    @DaleLJefferson

    It would be great to revisit this now, bigint is available in all environments.

    Image
  4. bilogic commented on Jul 10, 2025

    @bilogic

    Will this be a thing soon?

  5. mdhthahmd commented on Aug 22, 2026

    @mdhthahmd

    PR #39 adds opt-in BigInt support for encode() and decode(), including unsigned 64-bit values, input validation, TypeScript types, tests, and a usage example. Feedback and reviews are welcome! @4kimov

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions