mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
10 lines
192 B
TypeScript
10 lines
192 B
TypeScript
|
import {v4} from "uuid"
|
||
|
|
||
|
export function generateId(length = 64) {
|
||
|
let id = ''
|
||
|
while(id.length < length) {
|
||
|
id += v4().replace(/-/g, "")
|
||
|
}
|
||
|
return id.substr(0, length)
|
||
|
}
|