MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / generateRandomUnique

Function generateRandomUnique

Source/Core/CtrlrUtilities.cpp:316–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316const String generateRandomUnique(const String &additionalRandomData)
317{
318 Time t = Time::getCurrentTime();
319 Random r(t.getHighResolutionTicks());
320 String randData = additionalRandomData
321 + SystemStats::getComputerName()
322 + SystemStats::getCpuVendor()
323 + SystemStats::getFullUserName()
324 + SystemStats::getJUCEVersion()
325 + SystemStats::getLogonName()
326 + SystemStats::getOperatingSystemName();
327
328 BigInteger bi;
329 r.fillBitsRandomly(bi, 0, 64);
330
331 return (bi.toMemoryBlock().toBase64Encoding());
332}
333
334const String generateRandomUniquePluginId()
335{

Callers 2

CtrlrPanelMethod · 0.85
savePanelAsMethod · 0.85

Calls 4

fillBitsRandomlyMethod · 0.80
toBase64EncodingMethod · 0.80
toMemoryBlockMethod · 0.45

Tested by

no test coverage detected