1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add HLS encryption feature

This commit is contained in:
Harlan 2018-03-25 12:05:52 +08:00
parent 0d78b908a7
commit 52596a0b04
8 changed files with 378 additions and 11 deletions

View file

@ -1050,6 +1050,27 @@ int srs_do_create_dir_recursively(string dir)
}
return c;
}
char *ff_data_to_hex(char *buff, const uint8_t *src, int s, int lowercase)
{
int i;
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];
buff[i * 2 + 1] = hex_table[src[i] & 0xF];
}
return buff;
}
int ff_hex_to_data(uint8_t* data, const char* p)
{