PCL
Non-Cryptographic Hash Functions

Functions

uint32 pcl::Hash32 (const void *data, size_type size, uint32 seed=0)
 
uint64 pcl::Hash64 (const void *data, size_type size, uint64 seed=0)
 

Detailed Description

Function Documentation

◆ Hash32()

uint32 pcl::Hash32 ( const void *  data,
size_type  size,
uint32  seed = 0 
)
inline

Computes a 32-bit non-cryptographic hash function.

Parameters
dataAddress of the first byte of the input data block.
sizeLength in bytes of the input data block.
seedOptional seed value for initialization of the hash function. If seed is zero or is not specified, the seed will be set equal to the length of the data block.

Returns a 32-bit hash value computed from the input data block.

Test vector: "The quick brown fox jumps over the lazy dog"
Hash32 checksum = 752cd1b8

Test vector: "" (empty string)
Hash32 checksum = 2cc5d05

This function implements the xxHash algorithm by Yann Collet. Our code is an adaptation of the original code by the author:

https://github.com/Cyan4973/xxHash

Copyright (C) 2012-2014, Yann Collet. The original code has been released under the BSD 2-Clause License:

http://www.opensource.org/licenses/bsd-license.php

Definition at line 3699 of file Math.h.

Referenced by pcl::GenericVector< sample *>::Hash32(), pcl::Array< GenericVector< T > >::Hash32(), pcl::GenericMatrix< coefficient >::Hash32(), pcl::GenericString< char, IsoCharTraits, StandardAllocator >::Hash32(), and pcl::GenericImage< UInt8PixelTraits >::Hash32().

◆ Hash64()

uint64 pcl::Hash64 ( const void *  data,
size_type  size,
uint64  seed = 0 
)
inline

Computes a 64-bit non-cryptographic hash function.

Parameters
dataAddress of the first byte of the input data block.
sizeLength in bytes of the input data block.
seedOptional seed value for initialization of the hash function. If seed is zero or is not specified, the seed will be set equal to the length of the data block.

Returns a 64-bit hash value computed from the input data block.

Test vector: "The quick brown fox jumps over the lazy dog" Hash64 checksum = 9a11f5e9468d7425

Test vector: "" (empty string)
Hash64 checksum = ef46db3751d8e999

This function implements the xxHash algorithm by Yann Collet. Our code is an adaptation of the original code by the author:

https://github.com/Cyan4973/xxHash

Copyright (C) 2012-2014, Yann Collet. The original code has been released under the BSD 2-Clause License:

http://www.opensource.org/licenses/bsd-license.php

Definition at line 3551 of file Math.h.

Referenced by pcl::SortedArray< Node * >::Hash(), pcl::IndirectSortedArray< T, A >::Hash(), pcl::ReferenceSortedArray< T, A >::Hash(), pcl::GenericVector< sample *>::Hash(), pcl::Array< GenericVector< T > >::Hash(), pcl::IndirectArray< MetaObject >::Hash(), pcl::ReferenceArray< XMLNode >::Hash(), pcl::GenericMatrix< coefficient >::Hash(), pcl::GenericString< char, IsoCharTraits, StandardAllocator >::Hash(), pcl::GenericImage< UInt8PixelTraits >::Hash(), pcl::GenericVector< sample *>::Hash64(), pcl::Array< GenericVector< T > >::Hash64(), pcl::GenericMatrix< coefficient >::Hash64(), pcl::GenericString< char, IsoCharTraits, StandardAllocator >::Hash64(), and pcl::GenericImage< UInt8PixelTraits >::Hash64().