Skip to content

Commit 8cecbbb

Browse files
authored
chore(build): set project version to 1.0.0
1 parent dd9dfc9 commit 8cecbbb

7 files changed

Lines changed: 42 additions & 42 deletions

File tree

CMakeLists.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(siphash-hpp VERSION 1.0 LANGUAGES CXX)
2+
project(siphash_cpp VERSION 1.0.0 LANGUAGES CXX)
33

44
option(BUILD_TESTING "Build tests" ON)
55
option(BUILD_EXAMPLES "Build examples" OFF)
66

7-
add_library(siphash_hpp INTERFACE)
8-
target_include_directories(siphash_hpp INTERFACE
9-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/siphash-hpp>
10-
$<INSTALL_INTERFACE:include/siphash-hpp>)
11-
target_compile_features(siphash_hpp INTERFACE cxx_std_11)
7+
add_library(siphash_cpp INTERFACE)
8+
target_include_directories(siphash_cpp INTERFACE
9+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/siphash_cpp>
10+
$<INSTALL_INTERFACE:include/siphash_cpp>)
11+
target_compile_features(siphash_cpp INTERFACE cxx_std_11)
1212

1313
include(CMakePackageConfigHelpers)
1414

15-
install(TARGETS siphash_hpp EXPORT siphash-hpp-targets)
16-
install(DIRECTORY include/siphash-hpp/ DESTINATION include/siphash-hpp)
15+
install(TARGETS siphash_cpp EXPORT siphash_cpp-targets)
16+
install(DIRECTORY include/siphash_cpp/ DESTINATION include/siphash_cpp)
1717

18-
install(EXPORT siphash-hpp-targets
19-
FILE siphash-hpp-targets.cmake
20-
NAMESPACE siphash_hpp::
21-
DESTINATION lib/cmake/siphash-hpp)
18+
install(EXPORT siphash_cpp-targets
19+
FILE siphash_cpp-targets.cmake
20+
NAMESPACE siphash_cpp::
21+
DESTINATION lib/cmake/siphash_cpp)
2222

2323
configure_package_config_file(
24-
cmake/siphash-hpp-config.cmake.in
25-
${CMAKE_CURRENT_BINARY_DIR}/siphash-hpp-config.cmake
26-
INSTALL_DESTINATION lib/cmake/siphash-hpp)
24+
cmake/siphash_cpp-config.cmake.in
25+
${CMAKE_CURRENT_BINARY_DIR}/siphash_cpp-config.cmake
26+
INSTALL_DESTINATION lib/cmake/siphash_cpp)
2727

2828
write_basic_package_version_file(
29-
${CMAKE_CURRENT_BINARY_DIR}/siphash-hpp-config-version.cmake
29+
${CMAKE_CURRENT_BINARY_DIR}/siphash_cpp-config-version.cmake
3030
VERSION ${PROJECT_VERSION}
3131
COMPATIBILITY SameMajorVersion)
3232

3333
install(FILES
34-
${CMAKE_CURRENT_BINARY_DIR}/siphash-hpp-config.cmake
35-
${CMAKE_CURRENT_BINARY_DIR}/siphash-hpp-config-version.cmake
36-
DESTINATION lib/cmake/siphash-hpp)
34+
${CMAKE_CURRENT_BINARY_DIR}/siphash_cpp-config.cmake
35+
${CMAKE_CURRENT_BINARY_DIR}/siphash_cpp-config-version.cmake
36+
DESTINATION lib/cmake/siphash_cpp)
3737

3838
if(BUILD_EXAMPLES)
3939
add_executable(siphash_example examples/basic.cpp)
40-
target_link_libraries(siphash_example PRIVATE siphash_hpp)
40+
target_link_libraries(siphash_example PRIVATE siphash_cpp)
4141
endif()
4242

4343
if(BUILD_TESTING)
@@ -49,6 +49,6 @@ if(BUILD_TESTING)
4949
FetchContent_MakeAvailable(googletest)
5050

5151
add_executable(siphash_tests tests/siphash_tests.cpp)
52-
target_link_libraries(siphash_tests PRIVATE siphash_hpp gtest_main)
52+
target_link_libraries(siphash_tests PRIVATE siphash_cpp gtest_main)
5353
add_test(NAME siphash_tests COMMAND siphash_tests)
5454
endif()

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# siphash-hpp
1+
# siphash_cpp
22

3-
[![Linux](https://github.com/NewYaroslav/siphash-hpp/actions/workflows/CI-Linux.yml/badge.svg)](https://github.com/NewYaroslav/siphash-hpp/actions/workflows/CI-Linux.yml)
4-
[![Win](https://github.com/NewYaroslav/siphash-hpp/actions/workflows/CI-Win.yml/badge.svg)](https://github.com/NewYaroslav/siphash-hpp/actions/workflows/CI-Win.yml)
3+
[![Linux](https://github.com/NewYaroslav/siphash_cpp/actions/workflows/CI-Linux.yml/badge.svg)](https://github.com/NewYaroslav/siphash_cpp/actions/workflows/CI-Linux.yml)
4+
[![Win](https://github.com/NewYaroslav/siphash_cpp/actions/workflows/CI-Win.yml/badge.svg)](https://github.com/NewYaroslav/siphash_cpp/actions/workflows/CI-Win.yml)
55

66
[SipHash](https://en.wikipedia.org/wiki/SipHash) header only C ++ library.
77

@@ -17,11 +17,11 @@ Example:
1717
std::array<char, 16> key = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
1818
std::string data("hello");
1919

20-
std::cout << "SipHash-2-4 for 'hello': " << siphash_hpp::siphash_2_4(data, key) << std::endl;
21-
std::cout << "SipHash-4-8 for 'hello': " << siphash_hpp::siphash_4_8(data, key) << std::endl;
22-
std::cout << "SipHash-4-8 for 'hello': " << siphash_hpp::siphash(data, key, 4, 8) << std::endl;
20+
std::cout << "SipHash-2-4 for 'hello': " << siphash_cpp::siphash_2_4(data, key) << std::endl;
21+
std::cout << "SipHash-4-8 for 'hello': " << siphash_cpp::siphash_4_8(data, key) << std::endl;
22+
std::cout << "SipHash-4-8 for 'hello': " << siphash_cpp::siphash(data, key, 4, 8) << std::endl;
2323

24-
siphash_hpp::SipHash siphash;
24+
siphash_cpp::SipHash siphash;
2525
siphash.init(key, 2, 4);
2626
std::cout << "SipHash-2-4 for 'hello': " << siphash.update(data).digest() << std::endl;
2727
```

cmake/siphash-hpp-config.cmake.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmake/siphash_cpp-config.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@PACKAGE_INIT@
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/siphash_cpp-targets.cmake")

examples/basic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
#include "siphash.hpp"
66

7-
// Demonstrates hashing messages with siphash-hpp.
7+
// Demonstrates hashing messages with siphash_cpp.
88
int main() {
99
// 16-byte secret key. Replace with a random key in real applications.
1010
const std::array<char, 16> key{'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
1111
const std::string msg = "hello";
1212

1313
// Convenience function for SipHash-2-4.
14-
const uint64_t hash_2_4 = siphash_hpp::siphash_2_4(msg, key);
14+
const uint64_t hash_2_4 = siphash_cpp::siphash_2_4(msg, key);
1515
std::cout << "SipHash-2-4(\"" << msg << "\") = " << hash_2_4 << std::endl;
1616

1717
// Using the SipHash class for custom parameters.
18-
siphash_hpp::SipHash hasher;
18+
siphash_cpp::SipHash hasher;
1919
hasher.init(key, 4, 8); // c = 4, d = 8
2020
const uint64_t hash_4_8 = hasher.update(msg).digest();
2121
std::cout << "SipHash-4-8(\"" << msg << "\") = " << hash_4_8 << std::endl;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace std {
2424
}
2525
#endif
2626

27-
namespace siphash_hpp {
27+
namespace siphash_cpp {
2828

2929
template<typename T, typename = void>
3030
struct has_static_size : std::false_type {};

tests/siphash_tests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ TEST(SipHash, KnownValues) {
1414
std::array<char, 16> key = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
1515
std::string data = "hello";
1616

17-
EXPECT_EQ(4402678656023170274ULL, siphash_hpp::siphash_2_4(data, key));
18-
EXPECT_EQ(14986662229302055855ULL, siphash_hpp::siphash_4_8(data, key));
17+
EXPECT_EQ(4402678656023170274ULL, siphash_cpp::siphash_2_4(data, key));
18+
EXPECT_EQ(14986662229302055855ULL, siphash_cpp::siphash_4_8(data, key));
1919
}
2020

2121
TEST(SipHash, EmptyMessageArrayKey) {
2222
char key[16];
2323
for (int i = 0; i < 16; ++i) key[i] = static_cast<char>(i);
2424
std::string data;
25-
EXPECT_EQ(8246050544436514353ULL, siphash_hpp::siphash_2_4(data, key));
25+
EXPECT_EQ(8246050544436514353ULL, siphash_cpp::siphash_2_4(data, key));
2626
}
2727

2828
TEST(SipHash, SevenByteMessagePointerKey) {
@@ -32,7 +32,7 @@ TEST(SipHash, SevenByteMessagePointerKey) {
3232
std::string data = {
3333
char(0x80), char(0x81), char(0x82),
3434
char(0x83), char(0x84), char(0x85), char(0x86)};
35-
EXPECT_EQ(3571205124105766914ULL, siphash_hpp::siphash_2_4(data, key));
35+
EXPECT_EQ(3571205124105766914ULL, siphash_cpp::siphash_2_4(data, key));
3636
}
3737

3838
TEST(SipHash, EightByteMessageStdArrayKey) {
@@ -41,7 +41,7 @@ TEST(SipHash, EightByteMessageStdArrayKey) {
4141
std::string data = {
4242
char(0x80), char(0x81), char(0x82), char(0x83),
4343
char(0x84), char(0x85), char(0x86), char(0x87)};
44-
EXPECT_EQ(15639825339957833178ULL, siphash_hpp::siphash_2_4(data, key));
44+
EXPECT_EQ(15639825339957833178ULL, siphash_cpp::siphash_2_4(data, key));
4545
}
4646

4747
TEST(SipHash, LongMessageArrayKey) {
@@ -51,7 +51,7 @@ TEST(SipHash, LongMessageArrayKey) {
5151
char(0x80), char(0x81), char(0x82), char(0x83), char(0x84),
5252
char(0x85), char(0x86), char(0x87), char(0x88), char(0x89),
5353
char(0x8A), char(0x8B), char(0x8C), char(0x8D), char(0x8E)};
54-
EXPECT_EQ(10101490021502548721ULL, siphash_hpp::siphash_2_4(data, key));
54+
EXPECT_EQ(10101490021502548721ULL, siphash_cpp::siphash_2_4(data, key));
5555
}
5656

5757
TEST(SipHash, MessageLongerThan255Bytes) {
@@ -60,5 +60,5 @@ TEST(SipHash, MessageLongerThan255Bytes) {
6060
std::string data;
6161
data.reserve(300);
6262
for (int i = 0; i < 300; ++i) data.push_back(static_cast<char>(i));
63-
EXPECT_EQ(5407540081291524153ULL, siphash_hpp::siphash_2_4(data, key));
63+
EXPECT_EQ(5407540081291524153ULL, siphash_cpp::siphash_2_4(data, key));
6464
}

0 commit comments

Comments
 (0)