1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/src/utils/GeneratorHelpers.ts

10 lines
193 B
TypeScript
Raw Normal View History

2019-02-14 12:37:52 +01:00
import {v4} from "uuid"
export function generateId(length = 64) {
2019-02-21 18:14:07 +01:00
let id = ""
while (id.length < length) {
2019-02-14 12:37:52 +01:00
id += v4().replace(/-/g, "")
}
return id.substr(0, length)
}