From 5d4c660525f1eb16865cc440b2008702d31e7925 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 1 Jan 2017 09:51:03 +0800 Subject: [PATCH] data prefix added to key images and outputs checkers --- src/page.h | 8 ++++++++ src/templates/checkrawkeyimgs.html | 2 ++ src/templates/checkrawoutputkeys.html | 1 + 3 files changed, 11 insertions(+) diff --git a/src/page.h b/src/page.h index 92c3fc3..d85eef7 100644 --- a/src/page.h +++ b/src/page.h @@ -2334,6 +2334,10 @@ public: const size_t magiclen = strlen(KEY_IMAGE_EXPORT_FILE_MAGIC); + string data_prefix = xmreg::make_printable(decoded_raw_data.substr(0, magiclen)); + + context["data_prefix"] = data_prefix; + if (!strncmp(decoded_raw_data.c_str(), KEY_IMAGE_EXPORT_FILE_MAGIC, magiclen) == 0) { string error_msg = fmt::format("This does not seem to be key image export data."); @@ -2689,6 +2693,10 @@ public: const size_t magiclen = strlen(OUTPUT_EXPORT_FILE_MAGIC); + string data_prefix = xmreg::make_printable(decoded_raw_data.substr(0, magiclen)); + + context["data_prefix"] = data_prefix; + if (!strncmp(decoded_raw_data.c_str(), OUTPUT_EXPORT_FILE_MAGIC, magiclen) == 0) { string error_msg = fmt::format("This does not seem to be output keys export data."); diff --git a/src/templates/checkrawkeyimgs.html b/src/templates/checkrawkeyimgs.html index 0d9927c..811584f 100644 --- a/src/templates/checkrawkeyimgs.html +++ b/src/templates/checkrawkeyimgs.html @@ -22,6 +22,8 @@ +

Data file prefix: {{data_prefix}}

+ {{#has_error}}

Attempt failed

{{error_msg}}

diff --git a/src/templates/checkrawoutputkeys.html b/src/templates/checkrawoutputkeys.html index 5544df2..006fad0 100644 --- a/src/templates/checkrawoutputkeys.html +++ b/src/templates/checkrawoutputkeys.html @@ -21,6 +21,7 @@

(no javascript - no cookies - no web analytics trackers - no images - open sourced)

+

Data file prefix: {{data_prefix}}

{{#has_error}}

Attempt failed