Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P2284
collision check script
Active
Public
Actions
Authored by
•
Mattflaschen-WMF
on Nov 5 2015, 11:31 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
StructuredDiscussions
Referenced Files
F2920386: collision check script
Nov 5 2015, 11:31 PM
2015-11-05 23:31:03 (UTC+0)
Subscribers
None
<?php
require_once
(
getenv
(
'MW_INSTALL_PATH'
)
!==
false
?
getenv
(
'MW_INSTALL_PATH'
)
.
'/maintenance/Maintenance.php'
:
dirname
(
__FILE__
)
.
'/../../../maintenance/Maintenance.php'
);
class
CollisionScript
extends
Maintenance
{
public
function
execute
()
{
$timestamp
=
wfTimestamp
();
$usedUUIDs
=
array
();
$i
=
0
;
do
{
$uuid
=
Flow\Import\HistoricalUIDGenerator
::
historicalTimestampedUID88
(
$timestamp
);
$duplicate
=
isset
(
$usedUUIDs
[
$uuid
]
);
$usedUUIDs
[
$uuid
]
=
true
;
$i
++;
if
(
$i
%
1000
===
0
)
{
echo
"$i UIDs generated.
\n
"
;
}
}
while
(
!
$duplicate
);
echo
"Duplicate found after $i iterations
\n
"
;
}
}
$maintClass
=
'CollisionScript'
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
Event Timeline
•
Mattflaschen-WMF
edited the content of this paste.
(Show Details)
Nov 5 2015, 11:31 PM
2015-11-05 23:31:03 (UTC+0)
•
Mattflaschen-WMF
changed the title of this paste from untitled to
collision check script
.
•
Mattflaschen-WMF
updated the paste's language from
autodetect
to
php
.
•
Mattflaschen-WMF
added a project:
StructuredDiscussions
.
•
Mattflaschen-WMF
mentioned this in
T117907: Determine cause of historical UIDs colliding
.
Log In to Comment