objectid
Blazing fast, cross-platform ObjectId implementation for the dart language.
4.0.3
24K downloads/mo
#2008 most downloaded on pub.dev
gonuit/dart_objectid
What this package is like to depend on
Last release 4 months ago
01 Apr 2026
Ships fairly regularly
a new release about every 8 months
Nearly every release is documented
notes for 12 of 12 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
14 releases · first in 2020
2 releases in the last 12 months
see the full history below
Release timeline
14 releases · Sep 2020 to Apr 2026
2021
2022
2023
2024
2025
2026
Releases
latest 14-
4.0.301 Apr 2026Release notes
Open source → -
4.0.201 Apr 2026Release notes
Open source →What's Changed
- Fix
ObjectId.fromHexString(…)on web by @JonasWanke in #5- Rewrote
ObjectId.fromHexStringto parse hex directly into bytes, avoiding 32-bit bitwise limitation on web and improving performance (~4x faster).
- Rewrote
- Fixed
ObjectId.fromValuesweb support by replacing>> 32with integer division intoProcessUniqueBytes. - Fixed
Random.secure()fallback inFallbackProcessUniqueto catch all exceptions, enabling Node.js compatibility. - Added CI pipeline with formatting, analysis, and tests on VM, Chrome, and Node.js.
New Contributors
- @JonasWanke made their first contribution in #5
Full Changelog: v4.0.1...v4.0.2
Release notes
Open source →- Rewrote
ObjectId.fromHexStringto parse hex directly into bytes, avoiding 32-bit bitwise limitation on web and improving performance (~4x faster). - Fixed
ObjectId.fromValuesweb support by replacing>> 32with integer division intoProcessUniqueBytes. - Fixed
Random.secure()fallback inFallbackProcessUniqueto catch all exceptions, enabling Node.js compatibility. - Added CI pipeline with formatting, analysis, and tests on VM, Chrome, and Node.js.
- Fix
-
4.0.104 Jun 2025Release notes
Open source →Changes
- Removed deprecated implementation related to
dart:js_util.- Process unique on the web platform is now based on
Random.secured().
- Process unique on the web platform is now based on
Full Changelog: v4.0.0...v4.0.1
Release notes
Open source →- Removed deprecated implementation related to
dart:js_util.- Process unique on the web platform is now based on
Random.secured().
- Process unique on the web platform is now based on
- Removed deprecated implementation related to
-
4.0.007 Mar 2025Release notes
Open source → -
3.1.023 Sep 2024Release notes
Open source →Changes:
- Added the ObjectId.toJson() method to enable straightforward serialization of ObjectId instances. You can now serialize an ObjectId simply by calling jsonEncode or using the built-in JsonEncoder.
- Added the ObjectId.fromJson(String json) factory constructor. This serves as an alias to the existing ObjectId.fromHexString constructor, clearly indicating the intention to deserialize from a JSON value.
Resolves #3
Release notes
Open source →- Added the ObjectId.toJson() method to enable straightforward serialization of ObjectId instances. You can now serialize an ObjectId simply by calling jsonEncode or using the built-in JsonEncoder.
- Added the ObjectId.fromJson(String json) factory constructor. This serves as an alias to the existing ObjectId.fromHexString constructor, clearly indicating the intention to deserialize from a JSON value.
-
3.0.026 Jun 2023Release notes
Open source →Changes:
- ⚠️ The strict runtime type checking in the equals operator has been removed. Now all classes that extend ObjectId and have the same value will be matched by this operator.
class MyObjectId extends ObjectId {} const hexString = '606eed9d7203bfbbb7fffffe'; ObjectId.fromHexString(hexString) == MyObjectId.fromHexString(hexString); // true
- Updated dart sdk constraints to match new requirements.
- Updated package dependencies
- Replaced the code analysis rules defined by the effective_dart package with the lints package.
- Removed unnecessary (for packages) pubspec.lock file.
Full Changelog: v2.1.0...v3.0.0
Release notes
Open source →- ⚠️ The strict runtime type checking in the equals operator has been removed. Now all classes that extend ObjectId and have the same value will be matched by this operator.
class MyObjectId extends ObjectId {} const hexString = '606eed9d7203bfbbb7fffffe'; ObjectId(hexString) == MyObjectId(hexString); // true - Updated dart sdk constraints to match new requirements.
- Updated package dependencies
- Replaced the code analysis rules defined by the effective_dart package with the lints package.
- Removed unnecessary (for packages) pubspec.lock file.
- ⚠️ The strict runtime type checking in the equals operator has been removed. Now all classes that extend ObjectId and have the same value will be matched by this operator.
-
2.1.016 Mar 2022Release notes
Open source →Changes
- Constants
ObjectId.byteLengthandObjectId.hexStringLengthare now publicly available.
Release notes
Open source →- Constants
ObjectId.byteLengthandObjectId.hexStringLengthare now publicly available.
- Constants
-
2.0.008 Apr 2021Release notes
Open source →Changes:
- Stable nullsafety release
- Fixed a bug that caused the counter value to overflow at
0xfffffe.- Enabled counter overflow unit test.
toStringmethod now instead ofruntimeType(hexString), returns objectid'shexString.TIP:/// Before: print(ObjectId()) // => "ObjectId(606eed9d7203bfbbb7fffffe)" /// Now: print(ObjectId()) // => "606eed9d7203bfbbb7fffffe"
If you still want to use thetoStringmethod withruntimeType, you can override theObjectIdclass. Example:class MyObjectId extends ObjectId { @override String toString() => '$runtimeType($hexString)'; }
Release notes
Open source →- Stable nullsafety release
- Fixed a bug that caused the counter value to overflow at
0xfffffe.- Enabled counter overflow unit test.
toStringmethod now instead ofruntimeType(hexString), returns objectid'shexString.
TIP:/// Before: print(ObjectId()) // => "ObjectId(606eed9d7203bfbbb7fffffe)" /// Now: print(ObjectId()) // => "606eed9d7203bfbbb7fffffe"
If you still want to use thetoStringmethod withruntimeType, you can override theObjectIdclass. Example:class MyObjectId extends ObjectId { @override String toString() => '$runtimeType($hexString)'; }
-
2.0.0-nullsafety.023 Feb 2021 pre-releaseRelease notes
Open source →Changes:
- Initial move towards null safety
- Updated changelog (removed release dates)
Release notes
Open source →- Initial move towards nullsafety
- Updated changelog (removed release dates)
-
1.1.105 Sep 2020Release notes
Open source →- Use StringBuffer instead of String class for hexString generation (almost 5 times faster generation of hexStrings).
-
1.1.005 Sep 2020Release notes
Open source →- Migrate package to effective dart style.
- 100% tests coverage.
- Improve readme docs.
- Added badges.
- Added benchmark section.
-
1.0.005 Sep 2020 -
0.2.004 Sep 2020Release notes
Open source →- Added unit tests
- Restructured projects
- Added
fromBytes,fromValuesandfromTimestampconstructors. - Renamed
generationTimeproperty totimestamp. - Added missing
hashCodeimplementation based onmurmurHash2. - Added
bytesproperty.
-
0.1.0-dev.104 Sep 2020 pre-releaseRelease notes
Open source →- Added ObjectId class.
- Added
ObjectId()andObjectId.fromHexString()constructors. - Added
isValidhelper method. - Added equality operator overload
==. - Added
hexStringandgenerationTimegetters with caching support.
- Added
- Added ObjectId class.