@progress/kendo-angular-common
Version:
Kendo UI for Angular - Utility Package
20 lines (19 loc) • 780 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
/**
* @hidden
*/
export const guid = () => {
let id = "";
for (let i = 0; i < 32; i++) {
const random = Math.random() * 16 | 0; // eslint-disable-line no-bitwise
if (i === 8 || i === 12 || i === 16 || i === 20) {
id += "-";
}
// eslint-disable-next-line no-bitwise
id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
}
return id;
};