MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / newGuid

Function newGuid

src/mapboxgl/core/Util.js:185–193  ·  view source on GitHub ↗

* 随机生成id * @param attr * @returns {string}

(attr)

Source from the content-addressed store, hash-verified

183 * @returns {string}
184 */
185 newGuid(attr) {
186 let len = attr || 32;
187 let guid = "";
188 for (let i = 1; i < len; i++) {
189 let n = Math.floor(Math.random() * 16.0).toString(16);
190 guid += n;
191 }
192 return guid;
193 },
194 /**
195 * @description 十六进制转 RGBA 格式。
196 * @param {Object} hex - 十六进制格式。

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.45
randomMethod · 0.45

Tested by

no test coverage detected