summaryrefslogtreecommitdiffstats
path: root/chromium/components/variations/hashing.cc
blob: 68ab65ea5d2e87a036be31aa0d0d77fa5e6253b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2012 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/variations/hashing.h"

#include <string.h>

#include "base/metrics/metrics_hashes.h"
#include "base/strings/stringprintf.h"

namespace variations {

uint32_t HashName(base::StringPiece name) {
  return base::HashFieldTrialName(name);
}

std::string HashNameAsHexString(base::StringPiece name) {
  return base::StringPrintf("%x", HashName(name));
}

}  // namespace variations