Fix: use Bun.hash() when running under Bun#2
Fix: use Bun.hash() when running under Bun#2notSido wants to merge 1 commit intoithiria894:masterfrom
Conversation
Claude Code runs on Bun, which uses Bun.hash() (wyhash) instead of FNV-1a. The scripts were producing incorrect rolls because the hash function didn't match the runtime. Now auto-detects Bun and uses the correct hash, falling back to FNV-1a on Node. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThree hashing functions now conditionally leverage Bun's native hashing when the Bun runtime is detected, converting results to 32-bit unsigned integers, while falling back to existing FNV-1a implementations in other environments. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
this worked |
Summary
Bun.hash()(wyhash) instead of FNV-1a for hashing the user identityreroll.js,shiny_hunt.js,verify.js) now auto-detect Bun and useBun.hash(), falling back to FNV-1a on NodeTest plan
node verify.js auto— should use FNV-1a (unchanged behavior)bun verify.js auto— should useBun.hash()and show different resultsbun verify.js autooutput against actual/buddyresult in Claude Code🤖 Generated with Claude Code
Summary by CodeRabbit