Craig Hesling | dedf722 | 2021-04-08 13:08:34 -0700 | [diff] [blame] | 1 | // 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 | |
| 9 | namespace biod { |
| 10 | |
| 11 | std::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 |