Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Murmurhash Laravel Package

lastguest/murmurhash

A fast, dependency-free PHP implementation of MurmurHash (MurmurHash3) for non-cryptographic hashing. Generate consistent 32/128-bit hashes for sharding, caching keys, bloom filters, and partitioning. Simple API, Composer-ready, and easy to drop into Laravel or any PHP project.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. MurmurHash3 is a non-cryptographic, high-diffusion 32/128-bit hash. In a Laravel codebase it is not an architectural component — it is a leaf utility that shows up in four places: consistent-hash ring / shard assignment (cache, queue, DB partition keys), deterministic experiment bucketing (feature flags, A/B cohorts), deduplication and fingerprinting of payloads, and probabilistic structures (bloom filters, HyperLogLog). The package delivers exactly one static class with no framework coupling, no service provider, no config, no I/O. That is a strength for fit (zero intrusion) and a weakness for leverage (it does nothing a TPM can build a roadmap on — it is a primitive, not a capability). Adopt it only where the requirement is genuinely "stable, uniformly distributed, reproducible hash across processes and deploys," not merely "a hash."

Integration feasibility. composer require lastguest/murmurhash and call the static method. Effort is measured in hours, not sprints. The real feasibility question is not installation but whether we need MurmurHash3 specifically rather than a hash with good distribution. Decision matrix:

Option Availability Throughput Cross-language parity
lastguest/murmurhash Composer, pure PHP Low (userland loops, int masking) Yes — Murmur3 is a de facto standard
hash('xxh3') PHP 8.1+ native Very high (C) Partial
crc32() Core Very high Yes, but poor avalanche behavior
hash('sha256') Core Medium (C, with acceleration) Yes, cryptographic

If the answer is "we just need spread and speed," use xxh3. If the answer is "an existing Java/ClickHouse/Spark/Redis pipeline already buckets on Murmur3 and we must agree with it," this package earns its place.

Technical risk.

  • Unmaintained. Last release April 2021; single maintainer; reported dependents of zero. Bus factor is one, and the effective maintenance horizon is "already past."
  • Runtime parity risk (the serious one). Pure-PHP Murmur3 depends on integer overflow and bit-masking behavior that has historically differed on 32-bit vs 64-bit builds and shifted across PHP minor versions. If hash output feeds a persistent shard map or an experiment assignment that must remain stable across deploys and hosts, a silent divergence re-buckets users — with no exception, no alert, no error log. That is the worst failure class.
  • Performance ceiling. Userland PHP byte-wise mixing is roughly one to two orders of magnitude slower than native xxh3/crc32. Fine for per-request bucketing; not fine for hashing every row of a large export or every event in a hot ingestion path.
  • Low ecosystem validation. 129 stars and no dependents means the correctness burden is entirely ours.
  • No security surface. No deserialization, no network, no filesystem, no code execution beyond the algorithm — so it will not appear on a vulnerability report, which also means it will not appear on anyone's patch radar.

Key questions. Does any downstream system already compute Murmur3 such that parity is a hard requirement? What is the per-second call volume and does a userland hash fit the latency budget? Must assignments be stable for months or years across PHP upgrades? Can we satisfy the need with xxh3 plus a versioned salt? Who owns the golden-vector test suite?

Integration Approach

Stack fit. Laravel-agnostic and version-agnostic; no illuminate/* constraints, so no Composer conflict with the framework. Bind it behind an in-house contract rather than calling the static method at call sites:

  • App\Support\Hashing\Hasher interface with hash(string $input, int $seed = 0): int
  • Murmur3Hasher adapter delegating to the package
  • Xxh3Hasher / Crc32Hasher alternates, selectable by config
  • Container binding in a small service provider

This costs a day and converts an abandoned dependency into an implementation detail we can swap without touching domain code.

Migration path. Nothing to migrate in; the work is preventing migration later. Sequence:

  1. Golden-vector fixture first. Capture known Murmur3 outputs (reference vectors from the canonical C/Java implementations, plus platform-specific runs on our target PHP versions). This becomes a CI test that fails loudly if a PHP upgrade changes output. This test is the single highest-value artifact in the whole effort.
  2. Benchmark. Microbenchmark against xxh3 and crc32 at realistic payload sizes. Decide with numbers, not intuition.
  3. Adapter + config binding, defaulting to whichever implementation the benchmark and parity requirements select.
  4. Land in a reversible use case first — experiment bucketing or cache-key sharding where a re-bucket is a cache miss, not data loss. Defer any use in persistent partition assignment until the golden-vector suite has run green for a full PHP minor cycle.

Compatibility. Pin the exact version in composer.json and commit the lock file. Verify on the highest PHP minor in production; watch for deprecation notices (implicit nullable params, dynamic properties) that indicate the package was written for an older runtime. If the package is used, prefer vendoring the algorithm into our own namespace over depending on the Packagist artifact — the implementation is on the order of a hundred lines, and owning it eliminates the supply-chain and abandonment questions at negligible cost while preserving byte-for-byte output (validated by the same golden vectors).

Sequencing. Golden vectors → benchmark → interface + adapter → low-blast-radius use case → optional vendoring → expand. Do not let hashing choice block feature delivery; the interface lets the algorithm decision land late.

Operational Impact

Maintenance. Nominal runtime maintenance (no config, no migrations, no scheduled work, no external dependency) offset by a nonzero governance cost: an unmaintained, single-maintainer package on the dependency inventory. Treat it as frozen: freeze the version, forbid transitive upgrades, and require the golden-vector suite to pass on every PHP upgrade. Budget a few hours per year, not per sprint.

Support. No vendor, no SLA, no security advisories to monitor. Internal ownership must be explicit — an unwritten "whoever wrote it" is how a hashing regression goes undiagnosed for a quarter. Name an owner in the service catalog, even for a hundred lines.

Scaling. CPU-bound and single-threaded per call; scaling is linear with request/event volume and inversely with payload size. It is not a horizontal-scaling problem — it is a per-core throughput ceiling. If hashing appears in a hot loop or a queue worker processing large batches, it becomes a measurable tax on the workers that matter most. Benchmark before, not after.

Failure modes.

  • Silent output drift across PHP versions or 32-bit/64-bit hosts → re-bucketed experiments, cold caches, orphaned shard data. Highest severity, zero observability by default. Mitigation: golden-vector CI plus a health check that asserts a known input maps to a known bucket.
  • Sign/unsigned mishandling at the call site → negative keys, malformed cache keys, negative modulo into a partition array. Mitigation: normalize in the adapter (& 0x7fffffff or sprintf('%u', ...)), never at call sites.
  • Throughput saturation under batch workloads → latency creep rather than hard failure. Mitigation: benchmark and a fallback implementation behind the interface.
  • Composer resolution surprise if the package is later abandoned/yanked → build failure. Mitigation: vendored copy or committed lock file.

Ramp-up. Effectively zero — an engineer is productive in under an hour. The onboarding risk is inverted: because it is trivial, teams adopt it casually at call sites and the discipline (interface, golden vectors, unsigned normalization) is what erodes. Encode those three rules in the adapter and the CI suite so the package's simplicity does not become an argument against the guardrails.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin