1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Add some useful converters

This commit is contained in:
jsteube 2019-04-05 12:19:53 +02:00
parent f374da11e3
commit 2fab28a6f3
2 changed files with 41 additions and 0 deletions

View File

@ -58,6 +58,11 @@ size_t base64_encode (u8 (*f) (const u8), const u8 *in_buf, const size_t in_len,
void lowercase (u8 *buf, const size_t len);
void uppercase (u8 *buf, const size_t len);
u8 v8a_from_v32 (const u32 v32);
u8 v8b_from_v32 (const u32 v32);
u8 v8c_from_v32 (const u32 v32);
u8 v8d_from_v32 (const u32 v32);
u16 v16a_from_v32 (const u32 v32);
u16 v16b_from_v32 (const u32 v32);
u32 v32_from_v16ab (const u16 v16a, const u16 v16b);

View File

@ -839,6 +839,42 @@ void uppercase (u8 *buf, const size_t len)
for (size_t i = 0; i < len; i++) buf[i] = (u8) toupper ((int) buf[i]);
}
u8 v8a_from_v32 (const u32 v32)
{
vconv32_t v;
v.v32 = v32;
return v.v8a;
}
u8 v8b_from_v32 (const u32 v32)
{
vconv32_t v;
v.v32 = v32;
return v.v8b;
}
u8 v8c_from_v32 (const u32 v32)
{
vconv32_t v;
v.v32 = v32;
return v.v8c;
}
u8 v8d_from_v32 (const u32 v32)
{
vconv32_t v;
v.v32 = v32;
return v.v8d;
}
u16 v16a_from_v32 (const u32 v32)
{
vconv32_t v;