forked from cathugger/mkp224o
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
250 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
|
||
char *base16_to(char *dst, const u8 *src, size_t slen); | ||
size_t base16_from(u8 *dst, u8 *dmask, const char *src); | ||
// converts src[0:slen] to base16 string | ||
char *base16_to(char *dst,const u8 *src,size_t slen); | ||
// calculates length needed to store data converted to base16 | ||
#define BASE16_TO_LEN(l) (((l) * 8 + 3) / 4) | ||
// converts src string from base16 | ||
size_t base16_from(u8 *dst,u8 *dmask,const char *src); | ||
// calculates length needed to store data converted from base16 | ||
#define BASE16_FROM_LEN(l) (((l) * 4 + 7) / 8) | ||
// validates base16 string and optionally stores length of valid data | ||
// returns 1 if whole string is good, 0 if string contains invalid data | ||
int base16_valid(const char *src,size_t *count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
char *base32_to(char *dst, const u8 *src, size_t slen); | ||
size_t base32_from(u8 *dst, u8 *dmask, const char *src); | ||
// converts src[0:slen] to base32 string | ||
char *base32_to(char *dst,const u8 *src,size_t slen); | ||
// calculates length needed to store data converted to base32 | ||
#define BASE32_TO_LEN(l) (((l) * 8 + 4) / 5) | ||
// converts src string from base32 | ||
size_t base32_from(u8 *dst,u8 *dmask,const char *src); | ||
// calculates length needed to store data converted from base | ||
#define BASE32_FROM_LEN(l) (((l) * 5 + 7) / 8) | ||
// validates base32 string and optionally stores length of valid data | ||
// returns 1 if whole string is good, 0 if string contains invalid data | ||
int base32_valid(const char *src,size_t *count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.