mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
build(utils): build26 from 45504a2b
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
//#region src/string/generate-id.ts
|
||||
/**
|
||||
* Generate a unique-ish string ID via timestamp + random.
|
||||
*
|
||||
* @returns String in `timestamp-random` format (e.g. `"1738423156789-542891"`).
|
||||
*
|
||||
* @example
|
||||
* const id = generateId(); // "1738423156789-542891"
|
||||
*/
|
||||
function generateId() {
|
||||
return `${Date.now()}-${Math.floor(Math.random() * 1e6)}`;
|
||||
}
|
||||
//#endregion
|
||||
export { generateId };
|
||||
|
||||
//# sourceMappingURL=generate-id.js.map
|
||||
Reference in New Issue
Block a user