-
Notifications
You must be signed in to change notification settings - Fork 34
feat(core): Add bytesLen and bytesLenUnsafe utilities
#353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: bb381c1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for docsccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for appccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @phroi, 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 enhances the core utility library by adding two new functions, Highlights
Using Gemini Code AssistThe 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
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 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
|
✅ Deploy Preview for apiccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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 bytesLen and bytesLenUnsafe utility functions for calculating the byte length of hex-like values. The changes are well-documented and include examples. I've provided a couple of suggestions: one to optimize performance by handling ArrayBuffer more efficiently, and another to improve the clarity of the documentation for bytesLenUnsafe regarding its handling of non-standard odd-length hex strings.
✅ Deploy Preview for liveccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/gemini review |
There was a problem hiding this comment.
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 bytesLen and bytesLenUnsafe utilities for calculating the byte length of hex-like values. The implementation is well-documented and the logic for the unsafe version is clever and correct. I've suggested a performance optimization for the bytesLen function to more efficiently handle Uint8Array and ArrayBuffer inputs by adding fast paths for them.
|
@Hanssen0 feel free to review 🤗 Phroi %93 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for your contribution!
It's kinda weird to see bytes from HexLike, but I think it's a reasonable decision for the performance.
Please change the base of this commit to the releases/next branch.
Agreed, then again it's mostly Hex-related logic. Sure most also Bytes-related, but I wanted to avoid any possible form of circular dependency 🤣
Let me know how you want to proceed, P.S.: if it can help, I'm aware that Github is working on implementing support for interpendent PRs like these ones |
You're right! I didn't realize this before. I think there are two ways:
|
|
Your merge conflicts are my merge conflicts!!! 🤣 (local unstable CCC) Merging to master is fine (already fixed the patch to minor thing), let me know if you have any other feedback 🤗 BTW approx how far away would you estimate the next major release? (weeks, months, half a year) Phroi |
Hanssen0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I desperately want to finish it this month. There are still two PRs I want to release before that (#328 and #349), and we might also want to merge |

Added the utilities for calculating the byte len of a HexLike / Hex
Phroi