mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-24 22:00:18 +00:00
Fix #5556 - prints all hashes, even if have gap between the bits
This commit is contained in:
parent
84e871e456
commit
520106bac9
@ -271,11 +271,12 @@ static void algolist() {
|
||||
ut64 bits;
|
||||
int i;
|
||||
eprintf ("Available Hashes: \n");
|
||||
for (i = 0; ; i++) {
|
||||
bits = ((ut64)1) << i;
|
||||
for (i = 0; i < R_HASH_NBITS; i++) {
|
||||
bits = 1ULL << i;
|
||||
const char *name = r_hash_name (bits);
|
||||
if (!name || !*name) break;
|
||||
printf (" %s\n", name);
|
||||
if (name && *name) {
|
||||
printf (" %s\n", name);
|
||||
}
|
||||
}
|
||||
eprintf ("\n");
|
||||
eprintf ("Available Encoders/Decoders: \n");
|
||||
|
@ -1590,11 +1590,12 @@ static void disasm_strings(RCore *core, const char *input, RAnalFunction *fcn) {
|
||||
|
||||
static void algolist(int mode) {
|
||||
int i;
|
||||
for (i = 0; ; i++) {
|
||||
ut64 bits = ((ut64)1) << i;
|
||||
for (i = 0; i < R_HASH_NBITS ; i++) {
|
||||
ut64 bits = 1ULL << i;
|
||||
const char *name = r_hash_name (bits);
|
||||
if (!name || !*name) break;
|
||||
r_cons_println (name);
|
||||
if (name && *name) {
|
||||
r_cons_println (name);
|
||||
}
|
||||
}
|
||||
if (!mode) r_cons_newline ();
|
||||
}
|
||||
|
@ -80,6 +80,8 @@ typedef struct r_hash_seed_t {
|
||||
#define R_HASH_SIZE_HAMDIST 1
|
||||
#define R_HASH_SIZE_LUHN 1
|
||||
|
||||
#define R_HASH_NBITS (8*sizeof(ut64))
|
||||
|
||||
#define R_HASH_NONE 0
|
||||
#define R_HASH_MD5 1
|
||||
#define R_HASH_SHA1 2
|
||||
|
Loading…
Reference in New Issue
Block a user