Skip to content

Support Base58 #6

Description

@dipu-bd

Add a Base58 codec — the marquee gap for a crypto-family foundation (Bitcoin / IPFS CID / Ripple / Monero addresses & keys). Base58Check stays in hashlib; this ticket is the plain Base58 codec plus the reusable radix core.

Architecture fit

  • Introduces a new radix / bignum core under lib/src/core/ (base-256 ↔ base-58 via repeated division), reused by Base62 and Base45.
  • Leading-zero handling: each leading 0x00 byte maps to a leading 1 character and back — the classic Base58 convention. Test this explicitly.
  • Codec class in lib/src/codecs/base58.dart (private ctor, static const bitcoin / ripple / flickr instances as appropriate), public toBase58/fromBase58 in lib/src/base58.dart with codec: override, export in codecs_base.dart.

Differential oracle: package:base_codecs (dev-dep).

Spec: https://digitalbazaar.github.io/base58-spec/

Effort: L · Sequence: first codec — establishes the radix core.

Checklist

  • Radix core with repeated-division encode / decode
  • Leading-zero → leading-1 mapping, tested at boundaries
  • Generated alphabet table + alphabet-string assertion
  • Six standard test groups incl. differential vs base_codecs
  • Web-safe: no 32-bit-shift assumptions in the division loop (node)
  • README / CHANGELOG / example / test_integration updated

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