MurmurHash API - Ruby Gem

MurmurHash generates fast, non-cryptographic hashes using the MurmurHash3 algorithm. Ideal for hash tables, data partitioning, bloom filters, and checksums where cryptographic security isn't needed.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_murmurhash'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_murmurhash

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_murmurhash'

# Initialize the client
client = APIVerve::Murmurhash::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({
  text: "hello world",
  seed: 0,
  variant: "32"
})

# Print the response
puts response

Error Handling

begin
  response = client.execute({ text: "hello world", seed: 0, variant: "32" })
  puts response["data"]
rescue APIVerve::Murmurhash::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Murmurhash::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Murmurhash::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "hash": 1586663183,
    "hashHex": "5e928f0f",
    "variant": "murmur3_32",
    "seed": 0
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.