The city-hash Reference Manual

This is the city-hash Reference Manual, version 1.8, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:39:49 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 city-hash

CityHash hash functions

Author

Robert Brown

License

MIT License. See the copyright messages in individual files.

Long Description

A Common Lisp implementation of Google’s CityHash family of hash functions. The Lisp algorithm is identical to that of Google’s open source C++ code, release 1.1.1

Version

1.8

Defsystem Dependency

com.google.base (system).

Dependencies
  • com.google.base (system).
  • nibbles (system).
  • sb-rotate-byte (system).
  • swap-bytes (system).
Source

city-hash.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 city-hash/city-hash.asd

Source

city-hash.asd.

Parent Component

city-hash (system).

ASDF Systems

city-hash.


3.1.2 city-hash/package.lisp

Source

city-hash.asd.

Parent Component

city-hash (system).

Packages

city-hash.


3.1.3 city-hash/city-hash.lisp

Dependency

package.lisp (file).

Source

city-hash.asd.

Parent Component

city-hash (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 city-hash

An implementation of the CityHash family of hash functions.

Source

package.lisp.

Use List
  • com.google.base.
  • common-lisp.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: city-hash-128 (octets &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END and returns the 128-bit hash value as two values of type (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.

Function: city-hash-128-with-seed (octets x y &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with seeds X and Y, each of type (UNSIGNED-BYTE 64), and returns the 128-bit hash value as two values of type (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.

Function: city-hash-32 (octets &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8) from index START to index END and returns the 32-bit hash value as an (UNSIGNED-BYTE 32). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.

Function: city-hash-64 (octets &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8) from index START to index END and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.

Function: city-hash-64-with-seed (octets seed &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with SEED of type (UNSIGNED-BYTE 64), and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.

Function: city-hash-64-with-seeds (octets seed0 seed1 &key start end)

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with seeds SEED0 and SEED1, each of type (UNSIGNED-BYTE 64), and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Package

city-hash.

Source

city-hash.lisp.


5.2 Internals


5.2.1 Constants

Constant: +c1+
Package

city-hash.

Source

city-hash.lisp.

Constant: +c2+
Package

city-hash.

Source

city-hash.lisp.

Constant: +empty-octet-vector+
Package

city-hash.

Source

city-hash.lisp.

Constant: +k+
Package

city-hash.

Source

city-hash.lisp.

Constant: +k0+
Package

city-hash.

Source

city-hash.lisp.

Constant: +k1+
Package

city-hash.

Source

city-hash.lisp.

Constant: +k2+
Package

city-hash.

Source

city-hash.lisp.

Constant: +n+
Package

city-hash.

Source

city-hash.lisp.


5.2.2 Macros

Macro: incf32 (place x)

Increment, modulo 2^32, PLACE by X.

Package

city-hash.

Source

city-hash.lisp.

Macro: incf64 (place x)

Increment, modulo 2^64, PLACE by X.

Package

city-hash.

Source

city-hash.lisp.

Macro: logxorf (place x)

Logically exclusive or PLACE by X.

Package

city-hash.

Source

city-hash.lisp.

Macro: mod-2^32 (x)
Package

city-hash.

Source

city-hash.lisp.

Macro: mod-2^64 (x)
Package

city-hash.

Source

city-hash.lisp.

Macro: mulf32 (place x)

Multiply, modulo 2^32, PLACE by X.

Package

city-hash.

Source

city-hash.lisp.

Macro: mulf64 (place x)

Multiply, modulo 2^64, PLACE by X.

Package

city-hash.

Source

city-hash.lisp.

Macro: rotatef-right-32 (place x)

Rotate 32-bit PLACE right by X bit positions.

Package

city-hash.

Source

city-hash.lisp.

Macro: u32* (x y)
Package

city-hash.

Source

city-hash.lisp.

Macro: u32+ (x y)
Package

city-hash.

Source

city-hash.lisp.

Macro: u64* (x y)
Package

city-hash.

Source

city-hash.lisp.

Macro: u64+ (x y)
Package

city-hash.

Source

city-hash.lisp.

Macro: u64- (x y)
Package

city-hash.

Source

city-hash.lisp.


5.2.3 Ordinary functions

Function: city-murmur (octets x y start length)

Returns a 128-bit hash code. Based on City and Murmur128.

Package

city-hash.

Source

city-hash.lisp.

Function: fmix (h)

A 32-bit to 32-bit integer hash copied from Murmur3.

Package

city-hash.

Source

city-hash.lisp.

Function: hash32-length-0-to-4 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: hash32-length-13-to-24 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: hash32-length-5-to-12 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: hash64-length-0-to-16 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: hash64-length-16 (u v mul)
Package

city-hash.

Source

city-hash.lisp.

Function: hash64-length-17-to-32 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: hash64-length-33-to-64 (octets index length)
Package

city-hash.

Source

city-hash.lisp.

Function: mur (a h)

Helper from Murmur3 for combining two 32-bit values.

Package

city-hash.

Source

city-hash.lisp.

Function: rotate-right-32 (x shift)
Package

city-hash.

Source

city-hash.lisp.

Function: rotate-right-64 (x shift)
Package

city-hash.

Source

city-hash.lisp.

Function: shift-mix (x)
Package

city-hash.

Source

city-hash.lisp.

Function: weak-hash64-length-32-with-seeds (octets index a b)
Package

city-hash.

Source

city-hash.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   F   H   I   L   M   R   S   U   W  
Index Entry  Section

C
city-hash-128: Public ordinary functions
city-hash-128-with-seed: Public ordinary functions
city-hash-32: Public ordinary functions
city-hash-64: Public ordinary functions
city-hash-64-with-seed: Public ordinary functions
city-hash-64-with-seeds: Public ordinary functions
city-murmur: Private ordinary functions

F
fmix: Private ordinary functions
Function, city-hash-128: Public ordinary functions
Function, city-hash-128-with-seed: Public ordinary functions
Function, city-hash-32: Public ordinary functions
Function, city-hash-64: Public ordinary functions
Function, city-hash-64-with-seed: Public ordinary functions
Function, city-hash-64-with-seeds: Public ordinary functions
Function, city-murmur: Private ordinary functions
Function, fmix: Private ordinary functions
Function, hash32-length-0-to-4: Private ordinary functions
Function, hash32-length-13-to-24: Private ordinary functions
Function, hash32-length-5-to-12: Private ordinary functions
Function, hash64-length-0-to-16: Private ordinary functions
Function, hash64-length-16: Private ordinary functions
Function, hash64-length-17-to-32: Private ordinary functions
Function, hash64-length-33-to-64: Private ordinary functions
Function, mur: Private ordinary functions
Function, rotate-right-32: Private ordinary functions
Function, rotate-right-64: Private ordinary functions
Function, shift-mix: Private ordinary functions
Function, weak-hash64-length-32-with-seeds: Private ordinary functions

H
hash32-length-0-to-4: Private ordinary functions
hash32-length-13-to-24: Private ordinary functions
hash32-length-5-to-12: Private ordinary functions
hash64-length-0-to-16: Private ordinary functions
hash64-length-16: Private ordinary functions
hash64-length-17-to-32: Private ordinary functions
hash64-length-33-to-64: Private ordinary functions

I
incf32: Private macros
incf64: Private macros

L
logxorf: Private macros

M
Macro, incf32: Private macros
Macro, incf64: Private macros
Macro, logxorf: Private macros
Macro, mod-2^32: Private macros
Macro, mod-2^64: Private macros
Macro, mulf32: Private macros
Macro, mulf64: Private macros
Macro, rotatef-right-32: Private macros
Macro, u32*: Private macros
Macro, u32+: Private macros
Macro, u64*: Private macros
Macro, u64+: Private macros
Macro, u64-: Private macros
mod-2^32: Private macros
mod-2^64: Private macros
mulf32: Private macros
mulf64: Private macros
mur: Private ordinary functions

R
rotate-right-32: Private ordinary functions
rotate-right-64: Private ordinary functions
rotatef-right-32: Private macros

S
shift-mix: Private ordinary functions

U
u32*: Private macros
u32+: Private macros
u64*: Private macros
u64+: Private macros
u64-: Private macros

W
weak-hash64-length-32-with-seeds: Private ordinary functions