Files
nearby/cpp/platform/base/byte_utils.h
T
2020-11-23 22:28:06 -08:00

25 lines
561 B
C++

#ifndef PLATFORM_BASE_BYTE_UTILS_H_
#define PLATFORM_BASE_BYTE_UTILS_H_
#include "platform/base/byte_array.h"
namespace location {
namespace nearby {
class ByteUtils {
public:
static std::string ToFourDigitString(ByteArray& bytes);
private:
// The biggest prime number under 10000, used as a mod base to trim integers
// into 4 digits.
static constexpr int kHashBasePrime = 9973;
// The hash multiplier.
static constexpr int kHashBaseMultiplier = 31;
};
} // namespace nearby
} // namespace location
#endif // PLATFORM_BASE_BYTE_UTILS_H_