mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 01:49:13 +01:00
[WIP] Encryption for secure values (#183)
This commit is contained in:
8
src-web/hooks/useRandomKey.ts
Normal file
8
src-web/hooks/useRandomKey.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
import { generateId } from '../lib/generateId';
|
||||
|
||||
export function useRandomKey() {
|
||||
const [value, setValue] = useState<string>(generateId());
|
||||
const regenerate = useCallback(() => setValue(generateId()), []);
|
||||
return [value, regenerate] as const;
|
||||
}
|
||||
Reference in New Issue
Block a user