aboutsummaryrefslogtreecommitdiffstats
path: root/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-05-10 03:36:59 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-05-10 03:36:59 -0300
commit2864398c7b723c1d43166d422ea7028ef33cf9e3 (patch)
treeec63cd647239612167c36e521610f69023ed9303 /vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example
parent7ffd4d99bbb8e358c6694c27c7ff859967872ece (diff)
downloadRNT-2864398c7b723c1d43166d422ea7028ef33cf9e3.tar.gz
RNT-2864398c7b723c1d43166d422ea7028ef33cf9e3.zip
sqlite backend with actual pagination
Diffstat (limited to 'vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example')
-rw-r--r--vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/CMakeLists.txt5
-rw-r--r--vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/hasher.cpp22
-rw-r--r--vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/interactive_hasher.cpp26
3 files changed, 53 insertions, 0 deletions
diff --git a/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/CMakeLists.txt b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/CMakeLists.txt
new file mode 100644
index 0000000..adaf2cb
--- /dev/null
+++ b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_executable(hasher hasher.cpp)
+target_link_libraries(hasher PRIVATE picosha2)
+
+add_executable(interactive_hasher interactive_hasher.cpp)
+target_link_libraries(interactive_hasher PRIVATE picosha2) \ No newline at end of file
diff --git a/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/hasher.cpp b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/hasher.cpp
new file mode 100644
index 0000000..4903069
--- /dev/null
+++ b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/hasher.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+#include "../picosha2.h"
+
+void CalcAndOutput(const std::string& src){
+ std::cout << "src : \"" << src << "\"\n";
+ std::cout << "hash: " << picosha2::hash256_hex_string(src) << "\n" << std::endl;
+}
+
+int main(int argc, char* argv[])
+{
+ if(argc == 1){
+ CalcAndOutput("");
+ }
+ else{
+ for(int i = 1; i < argc; ++i){
+ CalcAndOutput(argv[i]);
+ }
+ }
+
+ return 0;
+}
+
diff --git a/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/interactive_hasher.cpp b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/interactive_hasher.cpp
new file mode 100644
index 0000000..f7b727b
--- /dev/null
+++ b/vcpkg_installed/vcpkg/blds/picosha2/src/v1.0.1-8b81a1a146.clean/example/interactive_hasher.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include "../picosha2.h"
+
+int main(int argc, char* argv[])
+{
+ std::cout << "Input freely. To get hash, input \"hash!\". " << std::endl;
+ picosha2::hash256_one_by_one hasher;
+ while(true){
+ hasher.init(); //reset hasher state
+ while(true){
+ std::string line;
+ std::getline(std::cin, line);
+ if(line == "hash!"){
+ break;
+ }
+ hasher.process(line.begin(), line.end());
+ }
+ hasher.finish();
+ std::string hex_str;
+ picosha2::get_hash_hex_string(hasher, hex_str);
+ std::cout << hex_str << std::endl;
+ }
+
+ return 0;
+}
+