Roll forward to cl/343785060

Signed-off-by: hai007 <hais@google.com>
This commit is contained in:
hai007
2020-11-23 22:28:06 -08:00
parent 25bf896257
commit e6d52359cf
27 changed files with 500 additions and 742 deletions
+24
View File
@@ -0,0 +1,24 @@
#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_