@@ -22,7 +22,7 @@ It provides a 12-byte binary id based on [the specification](https://www.mongodb
2222
2323#### Create a new ObjectId
2424
25- When no data is provided, a new unique identifier is generated.
25+ Generate a new unique identifier
2626
2727~~~ php
2828use SlimeSystems\ObjectId;
@@ -40,7 +40,7 @@ Accepts a binary string of exactly 12 bytes.
4040$id = ObjectId::fromBinary($raw);
4141~~~
4242
43- Invalid lengths (anything other than 12 bytes) will throw ` SlimeSystems\ObjectId\Exception\Invalid ` .
43+ Invalid binary will throw ` SlimeSystems\ObjectId\Exception\Invalid ` .
4444
4545#### From a hex string
4646
@@ -50,7 +50,7 @@ Accepts a 24-character hexadecimal string.
5050$id = ObjectId::fromString($hex);
5151~~~
5252
53- Invalid hex or invalid lengths will throw ` SlimeSystems\ObjectId\Exception\Invalid ` .
53+ Invalid hex string will throw ` SlimeSystems\ObjectId\Exception\Invalid ` .
5454
5555#### From a timestamp
5656
@@ -62,6 +62,8 @@ $id = ObjectId::fromTime($dateTime);
6262$id = ObjectId::fromTime($timestamp);
6363~~~
6464
65+ Invalid time will throw ` SlimeSystems\ObjectId\Exception\Invalid ` .
66+
6567#### ObjectIds for time comparison
6668
6769If you need an ObjectId for time comparisons, you can add ` unique: false ` to zeroes the last 8 bytes out:
@@ -71,6 +73,8 @@ $id = ObjectId::fromTime($time, unique: false);
7173// Last 8 bytes of the hex string will be "0000000000000000"
7274~~~
7375
76+ This also do not increase the internal counter for generating a unique identifier.
77+
7478### Conversions
7579
7680#### Convert to string
@@ -82,7 +86,7 @@ $id->toString() // return 24-digit hexadecimal string
8286#### Convert to binary
8387
8488~~~ php
85- $id->toBinary() // return 12 byte binary string
89+ $id->toBinary() // return 12- byte binary string
8690~~~
8791
8892#### Extracting the time
@@ -98,7 +102,7 @@ $time = $id->toTime();
98102
99103#### Human-readable inspection
100104
101- ` inspect() ` returns a more detailed string containing the hex form and extra info .
105+ ` inspect() ` returns a readable string containing the hex representation .
102106
103107~~~ php
104108$id->inspect() // return "SlimeSystems\ObjectId(<hexadecimal representation >)"
0 commit comments