aboutsummaryrefslogtreecommitdiff
path: root/src/hash/metrohash.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-08-26 16:13:19 -0500
committerame <[email protected]>2024-08-26 16:13:25 -0500
commitfda120441cabfefc511786d7a6af40eec9f181fa (patch)
tree5d6e80abc948ba0034d3b4f32bba6746d95735e5 /src/hash/metrohash.c
parent90c4b7dcbc57d2f86a77c997069d96158d54ca55 (diff)
use integer format macros
Diffstat (limited to 'src/hash/metrohash.c')
-rw-r--r--src/hash/metrohash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hash/metrohash.c b/src/hash/metrohash.c
index e27dfe7..080091b 100644
--- a/src/hash/metrohash.c
+++ b/src/hash/metrohash.c
@@ -1,5 +1,5 @@
#include "../crypto.h"
-#include <stdio.h>
+#include <inttypes.h>
#include <stdint.h>
#define u64(a) (*(uint64_t*)a)
@@ -169,7 +169,7 @@ int l_metrohash64_v1(lua_State* L){
char digest[64];
uint64_t u = metrohash64(a, len, seed, v1);
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}
@@ -184,7 +184,7 @@ int l_metrohash64_v2(lua_State* L){
char digest[64];
uint64_t u = metrohash64(a, len, seed, v2);
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}
@@ -200,7 +200,7 @@ int l_metrohash128_v1(lua_State* L){
uint64_t u1, u2;
metrohash128(a, len, seed, &u1, &u2, v1);
- sprintf(digest,"%016llx%016llx",u1,u2);
+ sprintf(digest,"%016"PRIx64"%016"PRIx64,u1,u2);
lua_pushstring(L, digest);
return 1;
}
@@ -216,7 +216,7 @@ int l_metrohash128_v2(lua_State* L){
uint64_t u1, u2;
metrohash128(a, len, seed, &u1, &u2, v2);
- sprintf(digest,"%016llx%016llx",u1,u2);
+ sprintf(digest,"%016"PRIx64"%016"PRIx64,u1,u2);
lua_pushstring(L, digest);
return 1;
}