The bearer code security scanning tool flags the uuid function in ol-layerswitcher.js for using Math.random() instead of a crypto library or crypto API.
It would be interesting to use https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID although that's a HTTPS only API, which is a bit annoying.
The original Stackoverflow used for the algorithm has changed its answer: http://stackoverflow.com/a/2117523/526860
Maybe this package could be used instead? https://www.npmjs.com/package/uuid
The bearer code security scanning tool flags the uuid function in ol-layerswitcher.js for using Math.random() instead of a crypto library or crypto API.
It would be interesting to use https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID although that's a HTTPS only API, which is a bit annoying.
The original Stackoverflow used for the algorithm has changed its answer: http://stackoverflow.com/a/2117523/526860
Maybe this package could be used instead? https://www.npmjs.com/package/uuid