gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: nicer order ids


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: nicer order ids
Date: Tue, 16 Jan 2018 15:07:25 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 8e2a1cf  nicer order ids
8e2a1cf is described below

commit 8e2a1cf439f575505338c11b3bd339d9e8661df4
Author: Florian Dold <address@hidden>
AuthorDate: Tue Jan 16 15:07:18 2018 +0100

    nicer order ids
---
 src/backend/taler-merchant-httpd_proposal.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_proposal.c 
b/src/backend/taler-merchant-httpd_proposal.c
index 82a38bd..61da3b3 100644
--- a/src/backend/taler-merchant-httpd_proposal.c
+++ b/src/backend/taler-merchant-httpd_proposal.c
@@ -203,13 +203,14 @@ proposal_put (struct MHD_Connection *connection,
     }
     off = strftime (buf,
                     sizeof (buf),
-                    "%H.%M.%S",
+                    "%Y.%j.%H.%M.%S",
                     tm_info);
-    snprintf (buf + off,
-             sizeof (buf) - off,
-              "-%llX",
-              (long long unsigned) GNUNET_CRYPTO_random_u64 
(GNUNET_CRYPTO_QUALITY_WEAK,
-                                                             UINT64_MAX));
+    buf[off++] = '-';
+    uint64_t rand = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
+                                              UINT64_MAX);
+    char *last = GNUNET_STRINGS_data_to_string (&rand, sizeof (uint64_t),
+                                                &buf[off], sizeof (buf) - off);
+    *last = '\0';
     json_object_set_new (order,
                          "order_id",
                          json_string (buf));

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]