Skip to content

Initial package implementation.#1

Merged
mark-dropbear merged 8 commits into
mainfrom
dev
Nov 5, 2025
Merged

Initial package implementation.#1
mark-dropbear merged 8 commits into
mainfrom
dev

Conversation

@mark-dropbear

Copy link
Copy Markdown
Contributor

No description provided.

@mark-dropbear

Copy link
Copy Markdown
Contributor Author

/gemini summary

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mark-dropbear, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers the foundational implementation of the base32_codec Dart package. It provides a robust and idiomatic Dart solution for Base32 encoding and decoding, supporting key standards like RFC 4648 and Crockford's Base32. The design emphasizes flexibility, efficiency, and adherence to dart:convert conventions, making it suitable for various data processing scenarios, including large data streams.

Highlights

  • New Base32 Codec Package: Introduced the base32_codec package for flexible and efficient Base32 encoding and decoding in Dart.
  • Multiple Variant Support: The package supports RFC 4648, RFC 4648 "Hex", and Crockford's Base32 alphabets.
  • Stream-Compatible API: A Codec-based API is provided, aligning with dart:convert conventions for both synchronous and asynchronous (stream-based) data processing.
  • Enhanced Code Quality: The analysis_options.yaml has been updated to enforce strict language features and a comprehensive set of linter rules.
  • Automated Dependency Updates: Dependabot configuration has been added to automatically manage package dependencies for the pub ecosystem.
  • Comprehensive Testing: A robust test suite is included, covering RFC 4648 test vectors and chunked conversion scenarios for all supported Base32 variants.
  • API Documentation: Full API documentation has been generated and included for the new package.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/dart.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the initial implementation of the base32_codec package. The overall structure and implementation are of high quality, with good documentation, clear code, and comprehensive tests. The use of modern Dart features like enhanced enums is commendable.

However, I've found a critical bug in the Base32Decoder implementation due to fall-through in a switch statement, which will cause incorrect behavior or exceptions when decoding. I've left specific comments with suggestions to fix this. Once that is addressed, this package will be in excellent shape for its initial release.

Comment thread lib/src/decoder.dart
Comment thread lib/src/decoder.dart
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request introduces the initial implementation of a new Dart package, base32_codec, designed for efficient and flexible Base32 encoding and decoding. It supports various Base32 standards and integrates seamlessly with Dart's dart:convert conventions for both immediate and stream-based data processing. The PR also includes significant updates to code quality enforcement, automated dependency management, and comprehensive testing, alongside generated API documentation.

Highlights

  • New Base32 Codec Package: Introduced the base32_codec package for flexible and efficient Base32 encoding and decoding in Dart.
  • Multiple Variant Support: The package supports RFC 4648, RFC 4648 "Hex", and Crockford's Base32 alphabets.
  • Stream-Compatible API: A Codec-based API is provided, aligning with dart:convert conventions for both synchronous and asynchronous (stream-based) data processing.
  • Enhanced Code Quality: The analysis_options.yaml has been updated to enforce strict language features and a comprehensive set of linter rules.
  • Automated Dependency Updates: Dependabot configuration has been added to automatically manage package dependencies for the pub ecosystem.
  • Comprehensive Testing: A robust test suite is included, covering RFC 4648 test vectors and chunked conversion scenarios for all supported Base32 variants.
  • API Documentation: Full API documentation has been generated and included for the new package.
  • Critical Decoding Bug Identified: Two critical bugs were identified in the Base32Decoder related to missing break statements in switch cases, leading to incorrect decoding logic for RFC variants in both convert and startChunkedConversion methods.
Changelog
  • .github/dependabot.yml
    • Added Dependabot configuration to automate dependency updates for the pub ecosystem.
  • .idx/mcp.json
    • Added configuration for the Dart MCP server.
  • CHANGELOG.md
    • Updated the changelog to reflect the initial release of the base32_codec package, detailing support for RFC 4648, RFC 4648 "Hex", and Crockford's Base32 alphabets, and the Codec-based API.
  • README.md
    • Completely rewritten to provide a detailed description of the base32_codec package, its features, getting started instructions, and usage examples for synchronous and asynchronous conversions. Contribution guidelines were also added.
  • analysis_options.yaml
    • Updated to enforce strict language features (strict-casts, strict-inference, strict-raw-types) and a comprehensive list of linter rules for improved code quality.
  • doc/api/__404error.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec-class-sidebar.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec-class.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec/Base32Codec.crockford.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec/Base32Codec.hex.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec/Base32Codec.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec/decoder.html
    • Added generated API documentation file.
  • doc/api/base32_codec/Base32Codec/encoder.html
    • Added generated API documentation file.
  • doc/api/base32_codec/base32_codec-library-sidebar.html
    • Added generated API documentation file.
  • doc/api/base32_codec/base32_codec-library.html
    • Added generated API documentation file.
  • doc/api/base32_codec/index.html
    • Added generated API documentation file.
  • doc/api/categories.json
    • Added generated API documentation file.
  • doc/api/index.html
    • Added generated API documentation file.
  • doc/api/index.json
    • Added generated API documentation file.
  • doc/api/search.html
    • Added generated API documentation file.
  • doc/api/static-assets/github.css
    • Added generated API documentation file.
  • doc/api/static-assets/highlight.pack.js
    • Added generated API documentation file.
  • doc/api/static-assets/play_button.svg
    • Added generated API documentation file.
  • doc/api/static-assets/readme.md
    • Added generated API documentation file.
  • doc/api/static-assets/search.svg
    • Added generated API documentation file.
  • doc/api/static-assets/styles.css
    • Added generated API documentation file.
  • example/base32_codec_example.dart
    • Updated the example file to demonstrate the usage of Base32Codec for different variants and decoding.
  • lib/base32_codec.dart
    • Updated the library description and exported src/codec.dart as the main public interface.
  • lib/src/base32_codec_base.dart
    • Removed the placeholder file base32_codec_base.dart.
  • lib/src/codec.dart
    • Added the Base32Codec class, implementing Codec<Uint8List, String>, with constructors for RFC 4648, RFC 4648 Hex, and Crockford variants.
  • lib/src/decoder.dart
    • Added the Base32Decoder class, extending Converter<String, Uint8List>, and its chunked conversion sink (_Base32DecoderSink) for decoding Base32 strings into Uint8List.
  • lib/src/encoder.dart
    • Added the Base32Encoder class, extending Converter<Uint8List, String>, and its chunked conversion sink (_Base32EncoderSink) for encoding Uint8List into Base32 strings.
  • lib/src/variants.dart
    • Added the Base32Variant enum to define the different Base32 alphabets (RFC 4648, RFC 4648 Hex, Crockford) and their properties (alphabet string, padding).
  • pubspec.yaml
    • Updated the package description, added repository and issue tracker links, and specified relevant topics (base32, rfc4648, codec).
  • test/base32_codec_test.dart
    • Rewrote the test file to include comprehensive test cases for Base32Codec covering RFC 4648, RFC 4648 Hex, and Crockford variants, including both direct conversion and chunked stream conversion, using test vectors from RFC 4648.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/dart.yml
Activity
  • mark-dropbear requested a summary of the pull request.
  • gemini-code-assist[bot] provided an initial summary of the changes.
  • gemini-code-assist[bot] identified a critical bug in lib/src/decoder.dart's convert method: missing break statements in the switch cases for rfc4648 and rfc4648Hex variants, leading to incorrect fall-through to the crockford logic.
  • gemini-code-assist[bot] identified a second critical bug in lib/src/decoder.dart's _Base32DecoderSink's add method: also missing break statements in the switch cases for RFC variants, causing incorrect chunked decoding.

@mark-dropbear mark-dropbear merged commit 37f5b0b into main Nov 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant