mirror of
https://github.com/lxsang/ant-http
synced 2025-07-24 17:49:46 +02:00
add json request support
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -320,11 +320,16 @@ char to_hex(char code) {
|
||||
return hex[code & 15];
|
||||
}
|
||||
unsigned hash(const char* key, int hash_size)
|
||||
{
|
||||
unsigned hashval = simple_hash(key);
|
||||
return hashval % hash_size;
|
||||
}
|
||||
unsigned simple_hash(const char* key)
|
||||
{
|
||||
unsigned hashval;
|
||||
for (hashval = 0; *key != '\0'; key++)
|
||||
hashval = *key + 31 * hashval;
|
||||
return hashval % hash_size;
|
||||
return hashval;
|
||||
}
|
||||
int is_file(const char* f)
|
||||
{
|
||||
|
@ -80,5 +80,6 @@ char *url_encode(const char *str);
|
||||
char from_hex(char ch);
|
||||
char to_hex(char code);
|
||||
unsigned hash(const char*, int);
|
||||
unsigned simple_hash(const char*);
|
||||
int is_file(const char* f);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user