We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a98d03 commit 821db0dCopy full SHA for 821db0d
src/random.ts
@@ -5,12 +5,14 @@ const maxDateNowValue = 8.64e15 // Fun fact: This will only work until the year
5
6
/**
7
* Generate a unique key in ascending or descending sequential order
8
- *
+ *
9
* In ascending mode it will use the Unix timestamp directly
10
* and in descending order the maxDateNowValue (8.64e15) - Unix timestamp
11
* to make sure key is sequential. Key will be timestamp in hex plus a 5 char random id.
12
13
* Note: Because of the timestamp in ms, key is only sequential until a certain point i.e two keys generated in the same ms.
14
+ * @param {boolean} ascending
15
+ * @returns {string} randomKey
16
*/
17
export const generateKey = (ascending: boolean): string => {
18
0 commit comments