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
195 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)
}