OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/common/id_util.h" | 5 #include "extensions/common/id_util.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/sha2.h" | 10 #include "crypto/sha2.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 // Converts a normal hexadecimal string into the alphabet used by extensions. | 14 // Converts a normal hexadecimal string into the alphabet used by extensions. |
15 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a | 15 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a |
16 // completely numeric host, since some software interprets that as an IP | 16 // completely numeric host, since some software interprets that as an IP |
17 // address. | 17 // address. |
18 static void ConvertHexadecimalToIDAlphabet(std::string* id) { | 18 static void ConvertHexadecimalToIDAlphabet(std::string* id) { |
19 for (size_t i = 0; i < id->size(); ++i) { | 19 for (size_t i = 0; i < id->size(); ++i) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 path_str[0] += ('A' - 'a'); | 64 path_str[0] += ('A' - 'a'); |
65 | 65 |
66 return base::FilePath(path_str); | 66 return base::FilePath(path_str); |
67 #else | 67 #else |
68 return path; | 68 return path; |
69 #endif | 69 #endif |
70 } | 70 } |
71 | 71 |
72 } // namespace id_util | 72 } // namespace id_util |
73 } // namespace extensions | 73 } // namespace extensions |
OLD | NEW |