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

xlnt-community / xlnt / 252f158c-55eb-4d18-8adb-b2a8814fb025

24 Jan 2026 10:35PM UTC coverage: 83.928% (+1.1%) from 82.793%
252f158c-55eb-4d18-8adb-b2a8814fb025

Pull #87

circleci

doomlaur
Update lcov from 2.3.2 to 2.4
Pull Request #87: Improve documentation when exceptions are thrown (fixes #81)

15265 of 19956 branches covered (76.49%)

722 of 901 new or added lines in 37 files covered. (80.13%)

15 existing lines in 5 files now uncovered.

12491 of 14883 relevant lines covered (83.93%)

12216.5 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)
2,300,554✔
32
{
33
    if (algorithm == hash_algorithm::sha512)
2,300,554✔
34
    {
35
        xlnt::detail::sha512(input, output);
700,168✔
36
    }
37
    else if (algorithm == hash_algorithm::sha1)
1,600,386!
38
    {
39
        xlnt::detail::sha1(input, output);
1,600,386✔
40
    }
41
    else
42
    {
NEW
43
        throw xlnt::unsupported("unsupported hash algorithm " + std::to_string(static_cast<int>(algorithm)));
×
44
    }
45
}
2,300,554✔
46

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

52
    return output;
554✔
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