chromium/components/crx_file/id_util.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/crx_file/id_util.h"

#include <stdint.h>

#include <string_view>

#include "base/files/file_path.h"
#include "base/hash/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "crypto/sha2.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"

namespace {

// Converts a normal hexadecimal string into the alphabet used by extensions.
// We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a
// completely numeric host, since some software interprets that as an IP
// address.
static void ConvertHexadecimalToIDAlphabet(std::string* id) {}

}  // namespace

namespace crx_file::id_util {

// First 16 bytes of SHA256 hashed public key.
const size_t kIdSize =;

std::string GenerateId(std::string_view input) {}

std::string GenerateIdFromHash(base::span<const uint8_t> hash) {}

std::string GenerateIdFromHex(const std::string& input) {}

std::string GenerateIdForPath(const base::FilePath& path) {}

std::string HashedIdInHex(const std::string& id) {}

base::FilePath MaybeNormalizePath(const base::FilePath& path) {}

bool IdIsValid(std::string_view id) {}

}  // namespace crx_file::id_util