mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Revert uuid.
This commit is contained in:
parent
1f2da530c9
commit
bd9ff9a0df
15 changed files with 31 additions and 16 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { startOfMonth } from 'date-fns';
|
||||
import { hash } from 'next-basics';
|
||||
import { v4, v5, validate } from 'uuid';
|
||||
|
||||
export function secret() {
|
||||
return hash(process.env.APP_SECRET || process.env.DATABASE_URL);
|
||||
|
|
@ -10,3 +11,13 @@ export function salt() {
|
|||
|
||||
return hash(secret(), ROTATING_SALT);
|
||||
}
|
||||
|
||||
export function uuid(...args) {
|
||||
if (!args.length) return v4();
|
||||
|
||||
return v5(hash(...args), v5.DNS);
|
||||
}
|
||||
|
||||
export function isUuid(value) {
|
||||
return validate(value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue