Code Duplication    Length = 3-4 lines in 2 locations

func/uuid.php 1 location

@@ 56-58 (lines=3) @@
53
    // Prepare custom string 2
54
    if (empty($s_cus2))
55
    	$s_cus2 = ClientIpToHex();
56
    if (8 != strlen($s_cus2))
57
    	$s_cus2 = substr($s_cus2 .
58
			sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff)), 0, 8);
59
    //if (empty($s_cus2) || (8 != strlen($s_cus2)))
60
    //	$s_cus2 = sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff));
61

src/Fwlib/Util/Uuid/Base16.php 1 location

@@ 152-155 (lines=4) @@
149
        if (empty($custom2)) {
150
            $custom2 = $this->getUtilContainer()->getIp()->toHex();
151
        }
152
        if (8 != strlen($custom2)) {
153
            $custom2 .= sprintf('%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff));
154
            $custom2 = substr($custom2, 0, 8);
155
        }
156
        $custom2p1 = substr($custom2, 0, 4);
157
        $custom2p2 = substr($custom2, -4);
158