feat: added randomly generated URLs
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
94f7400169
commit
51fc2867a8
6 changed files with 190 additions and 87 deletions
|
|
@ -10,6 +10,12 @@
|
|||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
static const size_t charset_len = sizeof(charset) - 1;
|
||||
|
||||
// Length of randomly generated keys
|
||||
#define RANDOM_KEY_LENGTH 4
|
||||
|
||||
/**
|
||||
* Type definition for the struct representing the current Trie.
|
||||
*
|
||||
|
|
@ -51,6 +57,14 @@ char * ternarytrie_search(TernaryTrie* trie, const char* string);
|
|||
*/
|
||||
bool ternarytrie_add(TernaryTrie* trie, const char* string, const char *payload);
|
||||
|
||||
/**
|
||||
* Add a payload by generating a random string as the key.
|
||||
*
|
||||
* @param trie
|
||||
* @return the generated key
|
||||
*/
|
||||
char *ternarytrie_add_random(TernaryTrie *trie, const char *payload);
|
||||
|
||||
/**
|
||||
* Remove a string from this trie.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue