Added details++; Vendor updates

This commit is contained in:
2017-09-24 18:42:53 +02:00
parent 848c9b1222
commit 783985b7ec
53 changed files with 761 additions and 447 deletions

View File

@@ -1,5 +1,10 @@
# ramsey/uuid Changelog
## 3.7.1
* Use `random_bytes()` when generating random nodes
* Set the multicast bit for random nodes, according to RFC 4122, §4.5, [#170](https://github.com/ramsey/uuid/pull/170), [#171](https://github.com/ramsey/uuid/pull/171), [#182](https://github.com/ramsey/uuid/pull/182)
## 3.7.0
_Released: 2017-08-04_

View File

@@ -31,6 +31,11 @@ class RandomNodeProvider implements NodeProviderInterface
*/
public function getNode()
{
return sprintf('%06x%06x', mt_rand(0, 0xffffff), mt_rand(0, 0xffffff));
$node = hexdec(bin2hex(random_bytes(6)));
// Set the multicast bit; see RFC 4122, section 4.5.
$node = $node | 0x010000000000;
return str_pad(dechex($node), 12, '0', STR_PAD_LEFT);
}
}