summaryrefslogtreecommitdiffhomepage
path: root/examples/hash_crc32_example
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-04 06:12:03 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-04 06:15:20 -0500
commit3c1fec18cc1d11d247cfd0bd23c199ea65f3d7bd (patch)
tree81a7e6bd2264f0e2740a74be05aa708c53f01000 /examples/hash_crc32_example
chore: OCL.FIX module, initial commit.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/hash_crc32_example')
-rw-r--r--examples/hash_crc32_example/CMakeLists.txt15
-rw-r--r--examples/hash_crc32_example/example.cc14
2 files changed, 29 insertions, 0 deletions
diff --git a/examples/hash_crc32_example/CMakeLists.txt b/examples/hash_crc32_example/CMakeLists.txt
new file mode 100644
index 0000000..9758bfa
--- /dev/null
+++ b/examples/hash_crc32_example/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+cmake_minimum_required(VERSION 3.15...3.31)
+
+project(
+ HashExample
+ VERSION 1.0
+ LANGUAGES CXX)
+
+find_package(Boost REQUIRED COMPONENTS container)
+
+add_executable(HashExample example.cc)
+
+set_property(TARGET HashExample PROPERTY CXX_STANDARD 20)
+target_include_directories(HashExample PUBLIC ../../include/ocl)
+target_link_libraries(HashExample PRIVATE Boost::container)
diff --git a/examples/hash_crc32_example/example.cc b/examples/hash_crc32_example/example.cc
new file mode 100644
index 0000000..bd27662
--- /dev/null
+++ b/examples/hash_crc32_example/example.cc
@@ -0,0 +1,14 @@
+#include <ocl/crc_hash.hpp>
+#include <ocl/print.hpp>
+
+int main(int argc, char** argv)
+{
+ if (argc != 2) return 1;
+
+ std::hash<ocl::crc_hash_trait> hash{};
+
+ ocl::io::enable_stdio_sync(false);
+ ocl::io::print(hash(argv[1]));
+
+ return 0;
+}