feat(core): Add bytesLen and bytesLenUnsafe utilities (#353)#392
Conversation
🦋 Changeset detectedLatest commit: 98597b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 liveccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for apiccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ 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. |
There was a problem hiding this comment.
Pull request overview
This PR adds byte-length helper utilities to the core hex module, intended to efficiently compute the byte size of HexLike inputs (with a fast-path for validated Hex strings), and publishes the change via a changeset.
Changes:
- Add
bytesLen(hexLike)utility that returns the byte length of aHexLikevalue. - Add
bytesLenUnsafe(hex)utility that computes byte length directly from a Hex string length (handling odd-digit hex). - Add a changeset bumping
@ckb-ccc/coreas a minor release for the new API.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/core/src/hex/index.ts | Introduces bytesLen and bytesLenUnsafe utilities for computing byte length of hex-like inputs. |
| .changeset/eighty-terms-cry.md | Declares a minor changeset for exposing the new utilities in @ckb-ccc/core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Cherry-pick #353