• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xlnt-community / xlnt / b5325487-b953-4fb3-ae7c-12335ef12dcb

02 Feb 2025 07:13PM UTC coverage: 81.7% (-1.8%) from 83.482%
b5325487-b953-4fb3-ae7c-12335ef12dcb

Pull #55

circleci

doomlaur
Fix CI to use the correct Docker image for code coverage tests
Pull Request #55: Add support for C++20 and C++23, and experimental support for C++26

78 of 142 new or added lines in 8 files covered. (54.93%)

304 existing lines in 28 files now uncovered.

11460 of 14027 relevant lines covered (81.7%)

1191795.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
./source/detail/cryptography/hash.cpp
1
// Copyright (c) 2017-2022 Thomas Fussell
2
// Copyright (c) 2024-2025 xlnt-community
3
//
4
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// of this software and associated documentation files (the "Software"), to deal
6
// in the Software without restriction, including without limitation the rights
7
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
// copies of the Software, and to permit persons to whom the Software is
9
// furnished to do so, subject to the following conditions:
10
//
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
13
//
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
// THE SOFTWARE
21
//
22
// @license: http://www.opensource.org/licenses/mit-license.php
23
// @author: see AUTHORS file
24

25
#include <detail/cryptography/hash.hpp>
26
#include <detail/cryptography/sha.hpp>
27

28
namespace xlnt {
29
namespace detail {
30

31
void hash(hash_algorithm algorithm, const std::vector<std::uint8_t> &input, std::vector<std::uint8_t> &output)
1,400,462✔
32
{
33
    if (algorithm == hash_algorithm::sha512)
1,400,462✔
34
    {
35
        xlnt::detail::sha512(input, output);
800,176✔
36
    }
37
    else if (algorithm == hash_algorithm::sha1)
600,286✔
38
    {
39
        xlnt::detail::sha1(input, output);
600,286✔
40
    }
41
    else
42
    {
43
        throw xlnt::exception("unsupported hash algorithm");
×
44
    }
45
}
1,400,462✔
46

47
std::vector<std::uint8_t> hash(hash_algorithm algorithm, const std::vector<std::uint8_t> &input)
462✔
48
{
49
    auto output = std::vector<std::uint8_t>();
462✔
50
    hash(algorithm, input, output);
462✔
51

52
    return output;
462✔
UNCOV
53
}
×
54

55
}; // namespace detail
56
}; // namespace xlnt
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc