Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Dec 2012 07:56:29 GMT
From:      Veniamin Gvozdikov <g.veniamin@googlemail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/174793: [new port]: devel/cityhash Family of hash functions
Message-ID:  <201212290756.qBT7uTYC020342@red.freebsd.org>
Resent-Message-ID: <201212290800.qBT800XE086193@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174793
>Category:       ports
>Synopsis:       [new port]: devel/cityhash Family of hash functions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 29 08:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Veniamin Gvozdikov
>Release:        FreeBSD 8.3-RELEASE-p5
>Organization:
>Environment:
FreeBSD ololo 8.3-RELEASE-p5 FreeBSD 8.3-RELEASE-p5 #0: Thu Dec  6 16:25:28 MSK 2012     root@ololo:/usr/obj/usr/src/sys/OLOLO  amd64
>Description:
CityHash provides hash functions for strings.  The functions mix the
input bits thoroughly but are not suitable for cryptography.  See
"Hash Quality," below, for details on how CityHash was tested and so on.

Functions by CityHash:

- CityHash32() returns a 32-bit hash.
- CityHash64() and similar return a 64-bit hash.
- CityHash128() and similar return a 128-bit hash and are tuned for
strings of at least a few hundred bytes.  Depending on your compiler
and hardware, it's likely faster than CityHash64() on sufficiently long
strings.  It's slower than necessary on shorter strings, but we expect
that case to be relatively unimportant.
- CityHashCrc128() and similar are variants of CityHash128() that depend
on _mm_crc32_u64(), an intrinsic that compiles to a CRC32 instruction
on some CPUs.  However, none of the functions we provide are CRCs.
- CityHashCrc256() is a variant of CityHashCrc128() that also depends
on _mm_crc32_u64().  It returns a 256-bit hash.

All members of the CityHash family were designed with heavy reliance
on previous work by Austin Appleby, Bob Jenkins, and others.
For example, CityHash32 has many similarities with Murmur3a.

>How-To-Repeat:

>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	cityhash
#	cityhash/Makefile
#	cityhash/distinfo
#	cityhash/pkg-descr
#	cityhash/files
#	cityhash/files/patch-src_city.cc
#	cityhash/pkg-plist
#
echo c - cityhash
mkdir -p cityhash > /dev/null 2>&1
echo x - cityhash/Makefile
sed 's/^X//' >cityhash/Makefile << '8f14a35ebe1cac84ec24f3b9ebe09944'
X# Created by: Gvozdikov Veniamin <g.veniamin@googlemail.com>
X# $FreeBSD$
X
XPORTNAME=	cityhash
XPORTVERSION=	1.1.0
XCATEGORIES=	devel
XMASTER_SITES=	GOOGLE_CODE
X
XMAINTAINER=	g.veniamin@googlemail.com
XCOMMENT=	Family of hash functions
X
XLICENSE=	MIT
X
XGNU_CONFIGURE=	yes
XUSE_LDCONFIG=	yes
X
X.include <bsd.port.mk>
8f14a35ebe1cac84ec24f3b9ebe09944
echo x - cityhash/distinfo
sed 's/^X//' >cityhash/distinfo << 'b74122d7ad64f33512bc291952a81891'
XSHA256 (cityhash-1.1.0.tar.gz) = 0d07c13c6caf7c798856efa76df7dd2a8d24539240449538316ba4c3bd084679
XSIZE (cityhash-1.1.0.tar.gz) = 355571
b74122d7ad64f33512bc291952a81891
echo x - cityhash/pkg-descr
sed 's/^X//' >cityhash/pkg-descr << 'abe6435308deb8d7316aea4861652f1e'
XCityHash provides hash functions for strings.  The functions mix the
Xinput bits thoroughly but are not suitable for cryptography.  See
X"Hash Quality," below, for details on how CityHash was tested and so on.
X
XFunctions by CityHash:
X
X- CityHash32() returns a 32-bit hash.
X- CityHash64() and similar return a 64-bit hash.
X- CityHash128() and similar return a 128-bit hash and are tuned for
Xstrings of at least a few hundred bytes.  Depending on your compiler
Xand hardware, it's likely faster than CityHash64() on sufficiently long
Xstrings.  It's slower than necessary on shorter strings, but we expect
Xthat case to be relatively unimportant.
X- CityHashCrc128() and similar are variants of CityHash128() that depend
Xon _mm_crc32_u64(), an intrinsic that compiles to a CRC32 instruction
Xon some CPUs.  However, none of the functions we provide are CRCs.
X- CityHashCrc256() is a variant of CityHashCrc128() that also depends
Xon _mm_crc32_u64().  It returns a 256-bit hash.
X
XAll members of the CityHash family were designed with heavy reliance
Xon previous work by Austin Appleby, Bob Jenkins, and others.
XFor example, CityHash32 has many similarities with Murmur3a.
X
XWWW: http://code.google.com/p/cityhash/
abe6435308deb8d7316aea4861652f1e
echo c - cityhash/files
mkdir -p cityhash/files > /dev/null 2>&1
echo x - cityhash/files/patch-src_city.cc
sed 's/^X//' >cityhash/files/patch-src_city.cc << 'eb3f06006ebaa480dafc5587f9b01ec3'
X--- src/city.cc.orig	2012-12-24 12:40:59.863562632 +0400
X+++ src/city.cc	2012-12-24 12:48:07.077276386 +0400
X@@ -60,6 +60,12 @@
X #define bswap_32(x) OSSwapInt32(x)
X #define bswap_64(x) OSSwapInt64(x)
X 
X+#elif defined __FreeBSD__
X+
X+#include <sys/endian.h>
X+#define bswap_32(x) bswap32(x)
X+#define bswap_64(x) bswap64(x)
X+
X #else
X 
X #include <byteswap.h>
eb3f06006ebaa480dafc5587f9b01ec3
echo x - cityhash/pkg-plist
sed 's/^X//' >cityhash/pkg-plist << '1eb80b2e4c9e3250b3c795987fe947ea'
Xinclude/city.h
Xlib/libcityhash.a
Xlib/libcityhash.la
Xlib/libcityhash.so
Xlib/libcityhash.so.0
X%%DOCSDIR%%/COPYING
X%%DOCSDIR%%/NEWS
X%%DOCSDIR%%/README
X@dirrm %%DOCSDIR%%
1eb80b2e4c9e3250b3c795987fe947ea
exit


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212290756.qBT7uTYC020342>