1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
3 * Ceph - scalable distributed file system
5 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 * This is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License version 2.1, as published by the Free Software
10 * Foundation. See file COPYING.
14 #ifndef CEPH_BLOBHASH_H
15 #define CEPH_BLOBHASH_H
20 - this is to make some of the STL types work with 64 bit values, string hash keys, etc.
21 - added when i was using an old STL.. maybe try taking these out and see if things
27 uint32_t operator()(const char *p, unsigned len) {
28 static rjhash<uint32_t> H;
30 while (len >= sizeof(acc)) {
32 p += sizeof(uint32_t);
33 len -= sizeof(uint32_t);
37 acc ^= (uint32_t)*p << sh;