Skip to content

feat(core): improve hex utils (#268)#391

Merged
Hanssen0 merged 3 commits into
ckb-devrel:releases/nextfrom
Hanssen0:feat/hex
Jun 29, 2026
Merged

feat(core): improve hex utils (#268)#391
Hanssen0 merged 3 commits into
ckb-devrel:releases/nextfrom
Hanssen0:feat/hex

Conversation

@Hanssen0

@Hanssen0 Hanssen0 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Cherry-pick #268

Copilot AI review requested due to automatic review settings June 29, 2026 01:40
@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit a32fb27
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/6a41dba0bf8e680008b3c7eb
😎 Deploy Preview https://deploy-preview-391--apiccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 83 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 95 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit a32fb27
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/6a41db9f5142dd00088e23c8
😎 Deploy Preview https://deploy-preview-391--docsccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🔴 down 13 from production)
Accessibility: 95 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 82 (🟢 up 7 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit a32fb27
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/6a41db9f84f3820008759482
😎 Deploy Preview https://deploy-preview-391--appccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 67 (🔴 down 12 from production)
Accessibility: 89 (🟢 up 1 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a32fb27

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@ckb-ccc/core Patch
@ckb-ccc/did-ckb Patch
@ckb-ccc/eip6963 Patch
@ckb-ccc/joy-id Patch
@ckb-ccc/lumos-patches Patch
@ckb-ccc/nip07 Patch
@ckb-ccc/okx Patch
@ckb-ccc/rei Patch
@ckb-ccc/shell Patch
@ckb-ccc/spore Patch
@ckb-ccc/ssri Patch
@ckb-ccc/type-id Patch
@ckb-ccc/udt Patch
@ckb-ccc/uni-sat Patch
@ckb-ccc/utxo-global Patch
@ckb-ccc/xverse Patch
@ckb-ccc/ccc Patch
ckb-ccc Patch
@ckb-ccc/connector Patch
@ckb-ccc/connector-react Patch

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

@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit a32fb27
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/6a41db9f5142dd00088e23c3
😎 Deploy Preview https://deploy-preview-391--liveccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 41 (🟢 up 2 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates core hex/number utilities to introduce stricter hex validation, avoid unnecessary re-normalization when input hex is already normalized, and adjust numToHex’s behavior/documentation toward a “normalized” hex format.

Changes:

  • Adds isHex(unknown): v is Hex as a validator for (normalized) hex strings.
  • Updates hexFrom to return early when given an already-normalized hex string.
  • Updates numToHex to add a non-negative guard and (currently) pad output to even-length hex.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/core/src/num/index.ts Changes numToHex semantics + JSDoc (non-negative guard; new normalization behavior).
packages/core/src/hex/index.ts Adds isHex and uses it to fast-path hexFrom for already-normalized hex strings.
.changeset/shiny-ants-say.md Declares a minor release for the hex utility behavior changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/num/index.ts Outdated
Comment thread packages/core/src/num/index.ts Outdated
Comment thread packages/core/src/hex/index.ts Outdated
Comment thread .changeset/shiny-ants-say.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread packages/core/src/hex/index.ts Outdated
Comment thread .changeset/shiny-ants-say.md Outdated
Comment thread .changeset/wise-news-admire.md Outdated
* feat(core): `hexFrom` passthru normalized hex and `numToHex` enforce hex normalization

* feat(core): improve `isHex`

* feat(core): improve `isHex` parameter

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread packages/core/src/hex/index.ts
Comment thread packages/core/src/num/index.ts
Comment thread .changeset/shiny-ants-say.md
Comment thread .changeset/wise-news-admire.md Outdated
@Hanssen0 Hanssen0 merged commit ccb86cf into ckb-devrel:releases/next Jun 29, 2026
11 of 13 checks passed
@Hanssen0 Hanssen0 deleted the feat/hex branch June 29, 2026 02:43
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.

3 participants