mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 22:26:04 +00:00
fhem.pl: add createUniqueId for betateilchen (Forum #31932)
git-svn-id: https://svn.fhem.de/fhem/trunk@7537 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0c4bae9ff5
commit
ded6eaf871
16
fhem/fhem.pl
16
fhem/fhem.pl
@ -100,6 +100,7 @@ sub computeClientArray($$);
|
||||
sub concatc($$$);
|
||||
sub configDBUsed();
|
||||
sub createNtfyHash();
|
||||
sub createUniqueId();
|
||||
sub devspec2array($);
|
||||
sub doGlobalDef($);
|
||||
sub escapeLogLine($);
|
||||
@ -111,6 +112,7 @@ sub fhemTzOffset($);
|
||||
sub getAllAttr($);
|
||||
sub getAllGets($);
|
||||
sub getAllSets($);
|
||||
sub getUniqueId();
|
||||
sub latin1ToUtf8($);
|
||||
sub myrename($$);
|
||||
sub notifyRegexpChanged($$);
|
||||
@ -4009,12 +4011,22 @@ getUniqueId()
|
||||
{
|
||||
my ($err, $uniqueID) = getKeyValue("uniqueID");
|
||||
return $uniqueID if(defined($uniqueID));
|
||||
srand(time);
|
||||
$uniqueID = join "",map { unpack "H*", chr(rand(256)) } 1..16;
|
||||
my ($uniqueID) = createUniqueId();
|
||||
setKeyValue("uniqueID", $uniqueID);
|
||||
return $uniqueID;
|
||||
}
|
||||
|
||||
my $srandUsed;
|
||||
sub
|
||||
createUniqueId()
|
||||
{
|
||||
my $uniqueID;
|
||||
srand(time) if(!$srandUsed);
|
||||
$srandUsed = 1;
|
||||
$uniqueID = join "",map { unpack "H*", chr(rand(256)) } 1..16;
|
||||
return $uniqueID;
|
||||
}
|
||||
|
||||
sub
|
||||
getKeyValue($)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user