mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
25 lines
561 B
C++
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_
|