• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium Authors
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 "base/hash/md5_constexpr.h"
6 
7 namespace base {
8 
9 // Ensure that everything works at compile-time by comparing to a few
10 // reference hashes.
11 constexpr char kMessage0[] = "message digest";
12 static_assert(MD5Hash64Constexpr(kMessage0) == 0xF96B697D7CB7938Dull,
13               "incorrect MD5Hash64 implementation");
14 
15 static_assert(MD5Hash32Constexpr(kMessage0) == 0xF96B697Dul,
16               "incorrect MD5Hash32 implementation");
17 
18 constexpr char kMessage1[] = "The quick brown fox jumps over the lazy dog";
19 static_assert(MD5Hash64Constexpr(kMessage1) == 0x9E107D9D372BB682ull,
20               "incorrect MD5Hash64 implementation");
21 
22 static_assert(MD5Hash32Constexpr(kMessage1) == 0x9E107D9Dul,
23               "incorrect MD5Hash32 implementation");
24 
25 }  // namespace base
26