Lua xxhash Module

1. Overview

Exposes the xxhash functions to Lua.

2. Module

The module is globally registered and returned by the require function.

2.1. Example Usage

require "xxhash"

local h = xxhash.h32("foobar")
-- h == 3986901679

2.2. Functions

2.2.1. h32

require "xxhash"
local hash = xxhash.h32("foobar")

Thirty two bit hash function.

Arguments

  • item (string/number) Item to hash
  • seed (unsigned/nil) Used to alter the result predictably (default 0)

Return

  • hash (unsigned)

2.2.2. h64

require "xxhash"
local hash = xxhash.h64("foobar")

Sixty four bit hash function.

Arguments

  • item (string/number) Item to hash
  • seed (unsigned long long/nil) Used to alter the result predictably (default 0)

Return

  • hash (unsigned long long)

results matching ""

    No results matching ""