feat: added secure random URL option
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
b66c0f0e00
commit
22a7b5b3fc
4 changed files with 101 additions and 52 deletions
|
|
@ -14,7 +14,8 @@ static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW
|
|||
static const size_t charset_len = sizeof(charset) - 1;
|
||||
|
||||
// Length of randomly generated keys
|
||||
#define RANDOM_KEY_LENGTH 4
|
||||
#define RANDOM_KEY_LENGTH_SHORT 4
|
||||
#define RANDOM_KEY_LENGTH_LONG 16
|
||||
|
||||
/**
|
||||
* Type definition for the struct representing the current Trie.
|
||||
|
|
@ -83,9 +84,10 @@ bool ternarytrie_add(TernaryTrie* trie, const char* key, Entry *entry);
|
|||
*
|
||||
* @param trie
|
||||
* @param entry entry to add
|
||||
* @param secure whether to generate a longer, more secure random key
|
||||
* @return the generated key
|
||||
*/
|
||||
char *ternarytrie_add_random(TernaryTrie *trie, Entry *entry);
|
||||
char *ternarytrie_add_random(TernaryTrie *trie, Entry *entry, bool secure);
|
||||
|
||||
/**
|
||||
* Remove an entry from this trie given its key.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue