7aa40497e3de9d571f2389bf16e01bc109629b06503b2a3858970443092d609b.json 3.1 KB

1
  1. {"ast":null,"code":"/**\n * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523\n * Be aware Math.random() could cause collisions, but:\n * \"All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide\"\n * @returns a pseudo random id\n */\nexport function RandomGUID() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, c => {\n const r = Math.random() * 16 | 0,\n v = c === \"x\" ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\n/**\n * Class used to manipulate GUIDs\n */\nexport const GUID = {\n /**\n * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523\n * Be aware Math.random() could cause collisions, but:\n * \"All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide\"\n * @returns a pseudo random id\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n RandomId: RandomGUID\n};","map":{"version":3,"names":["RandomGUID","replace","c","r","Math","random","v","toString","GUID","RandomId"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/guid.js"],"sourcesContent":["/**\n * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523\n * Be aware Math.random() could cause collisions, but:\n * \"All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide\"\n * @returns a pseudo random id\n */\nexport function RandomGUID() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0, v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n/**\n * Class used to manipulate GUIDs\n */\nexport const GUID = {\n /**\n * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523\n * Be aware Math.random() could cause collisions, but:\n * \"All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide\"\n * @returns a pseudo random id\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n RandomId: RandomGUID,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAAA,EAAG;EACzB,OAAO,sCAAsC,CAACC,OAAO,CAAC,OAAO,EAAGC,CAAC,IAAK;IAClE,MAAMC,CAAC,GAAIC,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAI,CAAC;MAAEC,CAAC,GAAGJ,CAAC,KAAK,GAAG,GAAGC,CAAC,GAAIA,CAAC,GAAG,GAAG,GAAI,GAAG;IACvE,OAAOG,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC;EACzB,CAAC,CAAC;AACN;AACA;AACA;AACA;AACA,OAAO,MAAMC,IAAI,GAAG;EAChB;AACJ;AACA;AACA;AACA;AACA;EACI;EACAC,QAAQ,EAAET;AACd,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}