1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-02 05:30:19 +00:00

Add function to check if vector represents a Base58 string

This commit is contained in:
Matt Covalt 2018-12-05 10:20:41 -08:00
parent 0076f4075b
commit 36bdcf844a

View File

@ -236,6 +236,26 @@ DECLSPEC int is_valid_hex_32 (const u32 v)
return 1;
}
DECLSPEC int is_valid_base58_8 (const u8 v)
{
if (v > 'z') return 0;
if (v < '1') return 0;
if ((v > '9') && (v < 'A')) return 0;
if ((v > 'Z') && (v < 'a')) return 0;
return 1;
}
DECLSPEC int is_valid_base58_32 (const u32 v)
{
if (is_valid_base58_8 ((u8) (v >> 0)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 8)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 16)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 24)) == 0) return 0;
return 1;
}
DECLSPEC int find_keyboard_layout_map (const u32 search, const int search_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt)
{
for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++)