From aa920550a8437f171d07f135d7121fe9cec3bb1b Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Thu, 5 Nov 2015 11:13:17 -0500 Subject: [PATCH] Fix comment; these are the least signifincant bits (LSBs), not MSBs Change-Id: I0102e4969d95c6392a48d4a5b2f2bec096a828a5 --- includes/utils/UIDGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/utils/UIDGenerator.php b/includes/utils/UIDGenerator.php index 4881e686a3..9ac500943d 100644 --- a/includes/utils/UIDGenerator.php +++ b/includes/utils/UIDGenerator.php @@ -135,7 +135,7 @@ class UIDGenerator { $time = $info[0]; $counter = $info[1]; } - // Take the 46 MSBs of "milliseconds since epoch" + // Take the 46 LSBs of "milliseconds since epoch" $id_bin = $this->millisecondsSinceEpochBinary( $time ); // Add a 10 bit counter resulting in 56 bits total $id_bin .= str_pad( decbin( $counter ), 10, '0', STR_PAD_LEFT ); @@ -191,7 +191,7 @@ class UIDGenerator { $counter = $info[1]; $clkSeq = $info[2]; } - // Take the 46 bits of "milliseconds since epoch" + // Take the 46 LSBs of "milliseconds since epoch" $id_bin = $this->millisecondsSinceEpochBinary( $time ); // Add a 20 bit counter resulting in 66 bits total $id_bin .= str_pad( decbin( $counter ), 20, '0', STR_PAD_LEFT ); @@ -526,7 +526,7 @@ class UIDGenerator { /** * @param array $time Result of UIDGenerator::millitime() - * @return string 46 MSBs of "milliseconds since epoch" in binary (rolls over in 4201) + * @return string 46 LSBs of "milliseconds since epoch" in binary (rolls over in 4201) * @throws RuntimeException */ protected function millisecondsSinceEpochBinary( array $time ) { -- 2.20.1