mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-13 08:25:13 +00:00
12 lines
361 B
TypeScript
12 lines
361 B
TypeScript
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
export class Guid {
|
|
static newGuid() {
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
const r = Math.random() * 16 | 0,
|
|
v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
return v.toString(16);
|
|
});
|
|
}
|
|
} |