SuperFastHash.h 965 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #ifndef __SUPER_FAST_HASH_H
  11. #define __SUPER_FAST_HASH_H
  12. #include <stdio.h>
  13. #include "NativeTypes.h"
  14. // From http://www.azillionmonkeys.com/qed/hash.html
  15. // Author of main code is Paul Hsieh
  16. // I just added some convenience functions
  17. // Also note http://burtleburtle.net/bob/hash/doobs.html, which shows that this is 20% faster than the one on that page but has more collisions
  18. uint32_t SuperFastHash (const char * data, int length);
  19. uint32_t SuperFastHashIncremental (const char * data, int len, unsigned int lastHash );
  20. uint32_t SuperFastHashFile (const char * filename);
  21. uint32_t SuperFastHashFilePtr (FILE *fp);
  22. #endif
粤ICP备19079148号