diff options
author | Martin Storsjö <martin@martin.st> | 2010-03-25 07:13:20 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-03-25 07:13:20 +0000 |
commit | ddbeb95447d237bd82a2234d15561ae2eeb88a4c (patch) | |
tree | bbaa9247dd0c8094b6489cd3b09cf7964d521ec3 /libavformat/utils.c | |
parent | bd01c39330280313eebab7594168cae6180a6aef (diff) | |
download | ffmpeg-ddbeb95447d237bd82a2234d15561ae2eeb88a4c.tar.gz |
Add a lowercase parameter to ff_data_to_hex
Originally committed as revision 22665 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index db1dc14bb6..dbcdab18c3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3464,13 +3464,18 @@ void ff_url_split(char *proto, int proto_size, } } -char *ff_data_to_hex(char *buff, const uint8_t *src, int s) +char *ff_data_to_hex(char *buff, const uint8_t *src, int s, int lowercase) { int i; - static const char hex_table[16] = { '0', '1', '2', '3', + static const char hex_table_uc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + static const char hex_table_lc[16] = { '0', '1', '2', '3', + '4', '5', '6', '7', + '8', '9', 'a', 'b', + 'c', 'd', 'e', 'f' }; + const char *hex_table = lowercase ? hex_table_lc : hex_table_uc; for(i = 0; i < s; i++) { buff[i * 2] = hex_table[src[i] >> 4]; |