summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts
index abbf44d..7e7b965 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -2,3 +2,9 @@
* Get the last item in t
*/
export const last = <T>(t: T[]): T => t[t.length - 1];
+
+/**
+ * Generate a random key with a seed
+ */
+export const getKey = (seed: string) =>
+ seed + Date.now() + Math.floor(Math.random() * 1000);