UNPKG

@robotical/appv2-analytics-gatherer

Version:

A tool that gathers data from the Apps and sends it to the Analytics server

11 lines (10 loc) 310 B
export default function () { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let autoId = ''; const array = new Uint8Array(20); crypto.getRandomValues(array); array.forEach(byte => { autoId += chars[byte % chars.length]; }); return autoId; }