blob: bb4fe44be4500e30a6804d35f132ad196f10cb5a [file] [log] [blame]
Craig Heslingdedf7222021-04-08 13:08:34 -07001// Copyright 2021 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "biod/utils.h"
6
7#include <string>
8
9namespace biod {
10
11std::string LogSafeID(const std::string& id) {
12 // Truncate the string to the first 2 chars without extending to 2 chars.
13 if (id.length() > 2) {
14 return id.substr(0, 2) + "*";
15 }
16 return id;
17}
18
19} // namespace biod