[PR #4738] [MERGED] Port HashOps (CRC32C) for item component hashes #5819

Closed
opened 2026-11-03 05:15:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4738
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/K-hashops


📝 Commits (1)

  • e921ddb Port HashOps (CRC32C) for item component hashes

📊 Changes

2 files changed (+353 additions, -0 deletions)

View changed files

➕ crates/horizon-protocol/src/hash_ops.rs (+352 -0)
📝 crates/horizon-protocol/src/lib.rs (+1 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3518

First of two PRs for the component hashes in HashedStack. This one adds the hashing primitive only; nothing calls it yet (PR 2 wires it into Hashed::of).

Rows

  • HashedPatchMap.create / HashedStack.create: groundwork. horizon-protocol/src/hash_ops.rs ports HashOps (CRC32C instance): every create* (tag bytes, little-endian payloads, UTF-16 strings, maps sorted by unsigned key then value hash, lists, byte/int/long arrays), the record builder, and NbtOps.convertTo(HashOps, tag) for NBT-valued codecs (custom_data).

Vanilla followed

net.minecraft.util.HashOps, NbtOps.convertTo, Guava Hashing.crc32c() / HashCode.asInt.

Tests

cargo test -p horizon-protocol --lib hash_ops: CRC-32C check values, payload layouts, map ordering, and hashes printed by vanilla's own HashOps.CRC32C_INSTANCE on the pinned 26.3 jars (int, string, float, boolean, lists, Unit.CODEC, a CompoundTag.CODEC compound).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4738 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/K-hashops` --- ### 📝 Commits (1) - [`e921ddb`](https://github.com/horizon-rust/horizon/commit/e921ddb7c52a268f4b693662c110392c36f6112f) Port HashOps (CRC32C) for item component hashes ### 📊 Changes **2 files changed** (+353 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-protocol/src/hash_ops.rs` (+352 -0) 📝 `crates/horizon-protocol/src/lib.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3518 First of two PRs for the component hashes in `HashedStack`. This one adds the hashing primitive only; nothing calls it yet (PR 2 wires it into `Hashed::of`). ## Rows - `HashedPatchMap.create` / `HashedStack.create`: groundwork. `horizon-protocol/src/hash_ops.rs` ports `HashOps` (CRC32C instance): every `create*` (tag bytes, little-endian payloads, UTF-16 strings, maps sorted by unsigned key then value hash, lists, byte/int/long arrays), the record builder, and `NbtOps.convertTo(HashOps, tag)` for NBT-valued codecs (`custom_data`). ## Vanilla followed `net.minecraft.util.HashOps`, `NbtOps.convertTo`, Guava `Hashing.crc32c()` / `HashCode.asInt`. ## Tests `cargo test -p horizon-protocol --lib hash_ops`: CRC-32C check values, payload layouts, map ordering, and hashes printed by vanilla's own `HashOps.CRC32C_INSTANCE` on the pinned 26.3 jars (int, string, float, boolean, lists, `Unit.CODEC`, a `CompoundTag.CODEC` compound). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5819
No description provided.