3232use function strlen ;
3333use function strtolower ;
3434use function substr ;
35+ use function trim ;
3536use function unpack ;
3637use function vsprintf ;
3738
@@ -57,28 +58,28 @@ final class UUID
5758 * When this namespace is specified, the name string
5859 * is a fully-qualified domain name.
5960 */
60- const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8 ' ;
61+ public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8 ' ;
6162
6263 /**
6364 * When this namespace is specified, the name string is a URL.
6465 */
65- const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8 ' ;
66+ public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8 ' ;
6667
6768 /**
6869 * When this namespace is specified, the name string is an ISO OID.
6970 */
70- const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8 ' ;
71+ public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8 ' ;
7172
7273 /**
7374 * When this namespace is specified, the name string is
7475 * an X.500 DN in DER or a text output format.
7576 */
76- const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8 ' ;
77+ public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8 ' ;
7778
7879 /**
7980 * Regex pattern for UUIDs
8081 */
81- const PATTERN = '[a-f0-9]{8}\-[a-f0-9]{4}\-[1|3|4|5][a-f0-9]{3}\-[a-f0-9]{4}\-[a-f0-9]{12} ' ;
82+ public const PATTERN = '[a-f0-9]{8}\-[a-f0-9]{4}\-[1|3|4|5][a-f0-9]{3}\-[a-f0-9]{4}\-[a-f0-9]{12} ' ;
8283
8384 /**
8485 * Generates a UUID based on the MD5 hash of a namespace
@@ -183,7 +184,7 @@ public static function v1(string|int $address = null): string
183184 return $ node = vsprintf ('%02x%02x%02x%02x ' , explode ('. ' , $ node ));
184185 }
185186 if ($ node = `hostname 2> /dev/null `) {
186- $ node = gethostbyname (\ trim ($ node ));
187+ $ node = gethostbyname (trim ($ node ));
187188 return $ node = vsprintf ('%02x%02x%02x%02x ' , explode ('. ' , $ node ));
188189 }
189190 // Cannot identify IP or host, fallback as described in
0 commit comments