Fix comment; these are the least signifincant bits (LSBs), not MSBs
authorMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 5 Nov 2015 16:13:17 +0000 (11:13 -0500)
committerTim Starling <tstarling@wikimedia.org>
Thu, 21 Jan 2016 22:13:22 +0000 (22:13 +0000)
Change-Id: I0102e4969d95c6392a48d4a5b2f2bec096a828a5

includes/utils/UIDGenerator.php

index 4881e68..9ac5009 100644 (file)
@@ -135,7 +135,7 @@ class UIDGenerator {
                        $time = $info[0];
                        $counter = $info[1];
                }
                        $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 );
                $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];
                }
                        $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 );
                $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()
 
        /**
         * @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 ) {
         * @throws RuntimeException
         */
        protected function millisecondsSinceEpochBinary( array $time ) {