blob: ff2dbfd0c7666de0db5abc4cf54b2ad2ebdb1abe (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
size_t
inithashers(struct algorithm *algorithms, size_t nalgorithms)
{
size_t i;
for (i = 0; i < nalgorithms;) {
if (libhashsum_init_hasher_from_string(&algorithms[i].hasher, algorithms[i].algostr)) {
weprintf("%s:", algorithms[i].algostr);
free(algorithms[i].result);
/* keep order */
memmove(&algorithms[i], &algorithms[i + 1U], (--nalgorithms - i) * sizeof(*algorithms));
} else {
algorithms[i].offset = 0;
i++;
}
}
return nalgorithms;
}
|