@@ -131,7 +131,14 @@ static bool gguf_hash(const hash_params & hash_params) {
131
131
132
132
// Per Layer Hash
133
133
XXH64_hash_t hash = XXH64 (raw_data, n_bytes, 0 );
134
- printf (" xxhash %016lx %s:%s\n " , hash, fname.c_str (), name);
134
+
135
+ char hex_result[17 ];
136
+ for (int offset = 0 ; offset < 8 ; offset++) {
137
+ unsigned int shift_bits_by = (8 * (8 - offset - 1 ));
138
+ sprintf ( ( hex_result + (2 *offset)), " %02x" , (unsigned char ) (hash >> shift_bits_by)&0xff );
139
+ }
140
+
141
+ printf (" xxhash %s %s:%s\n " , hex_result, fname.c_str (), name);
135
142
136
143
// Overall Model Hash
137
144
if (XXH64_update (xxhash_model_hash_state, raw_data, n_bytes) == XXH_ERROR) abort ();
@@ -157,7 +164,14 @@ static bool gguf_hash(const hash_params & hash_params) {
157
164
158
165
if (hash_params.xxhash ) {
159
166
XXH64_hash_t const hash = XXH64_digest (xxhash_model_hash_state);
160
- printf (" xxhash %016lx %s\n " , hash, fname.c_str ());
167
+
168
+ char hex_result[17 ];
169
+ for (int offset = 0 ; offset < 8 ; offset++) {
170
+ unsigned int shift_bits_by = (8 * (8 - offset - 1 ));
171
+ sprintf ( ( hex_result + (2 *offset)), " %02x" , (unsigned char ) (hash >> shift_bits_by)&0xff );
172
+ }
173
+
174
+ printf (" xxhash %s %s\n " , hex_result, fname.c_str ());
161
175
}
162
176
163
177
if (hash_params.sha1 ) {
0 commit comments