| Index: components/cryptauth/remote_device.cc
|
| diff --git a/components/cryptauth/remote_device.cc b/components/cryptauth/remote_device.cc
|
| index f30aee139320b4b32e0a63b6d633cdfec7b41606..da0a0583df0dfe0269594a9a15c079c7d7e19246 100644
|
| --- a/components/cryptauth/remote_device.cc
|
| +++ b/components/cryptauth/remote_device.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "components/cryptauth/remote_device.h"
|
|
|
| +#include "base/base64.h"
|
| +
|
| namespace cryptauth {
|
|
|
| RemoteDevice::RemoteDevice() : bluetooth_type(BLUETOOTH_CLASSIC) {}
|
| @@ -27,4 +29,19 @@ RemoteDevice::RemoteDevice(const RemoteDevice& other) = default;
|
|
|
| RemoteDevice::~RemoteDevice() {}
|
|
|
| +std::string RemoteDevice::GetDeviceId() {
|
| + std::string to_return;
|
| + base::Base64Encode(public_key, &to_return);
|
| + return to_return;
|
| +}
|
| +
|
| +std::string RemoteDevice::GetTruncatedDeviceIdForLogs() {
|
| + std::string id = GetDeviceId();
|
| + if (id.length() <= 10) {
|
| + return id;
|
| + }
|
| +
|
| + return id.substr(0, 5) + "..." + id.substr(id.length() - 5, id.length());
|
| +}
|
| +
|
| } // namespace cryptauth
|
|
|