blob: 89e8e58ca1c05a483cebb3a8302b214d6e89f066 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstddef>
namespace vespalib {
/**
* Compute Hamming distance between two binary blobs
*
* @param lhs a blob (to interpret as a bitvector with sz*8 bits)
* @param rhs a blob (to interpret as a bitvector with sz*8 bits)
* @param sz number of bytes in each blob
* @return number of bits that differ when comparing the two blobs
**/
size_t binary_hamming_distance(const void *lhs, const void *rhs, size_t sz);
}
|