const idMaps = new Set(); export class Utils { static createHtmlId(): string { const id = `u-editor-${Utils.createBytes(6)}`; if (idMaps.has(id)) { return Utils.createHtmlId(); } idMaps.add(id) return id; } static createByte() { return Math.floor(Math.random() * 16).toString(16); } static createBytes(len: number) { let value: string = ""; for (let i = 0; i < len; i++) { value += Utils.createByte(); } return value; } }