@geneui/components
Version:
The Gene UI components library designed for BI tools
17 lines (12 loc) • 513 B
JavaScript
/** UUID generator
* Function provides "unique" id.
* Must be used with React iterable components.
*/
const hash = () => Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
/** @function guid
* @description
* The function generates uuid. It can be used as `key`-s needed for
* React iterated components
*/
const guid = () => "".concat(hash() + hash(), "-").concat(hash(), "-").concat(hash(), "-").concat(hash(), "-").concat(hash()).concat(hash()).concat(hash());
export { guid as g };