Skip to content

Support Base62 and Base36 #14

Description

@dipu-bd

Add Base62 and Base36 for URL shorteners, short DB IDs, and compact tokens.

Architecture fit

  • Base36 is a thin wrapper over the existing BigIntCodec — bytes → BigInt → radix-36 string, and back. Cheap ergonomic win.
  • Base62 needs a leading-zero convention (like Base58) so that leading 0x00 bytes survive the BigInt round-trip; document the chosen convention.
  • Public toBase62/fromBase62, toBase36/fromBase36 with codec: overrides; exports in codecs_base.dart.

Differential oracle: cross-check Base36 against BigInt.toRadixString(36) for the numeric core; Base62 leading-zero behavior needs vendored vectors.

Effort: S–M

Checklist

  • Base36 wrapper on BigIntCodec
  • Base62 with documented leading-zero convention
  • Alphabet-string assertions for both
  • Six standard test groups incl. differential/known-answer vectors
  • README / CHANGELOG / example / test_integration updated
  • Format / analyze / test (vm + node) green

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions