PackageTrack
Sign in Get early access

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
Release Pre-release

Releases

latest 14
  1. 4.0.3 01 Apr 2026
    Release notes

    Changes

    • Updated dependencies and README.
    • Updated benchmark results.

    Full Changelog: v4.0.2...v4.0.3

    Open source →
    Release notes
    • Updated dependencies and README.
    • Updated benchmark results.
    Open source →
  2. 4.0.2 01 Apr 2026
    Release notes

    What's Changed

    • Fix ObjectId.fromHexString(…) on web by @JonasWanke in #5
      • Rewrote ObjectId.fromHexString to parse hex directly into bytes, avoiding 32-bit bitwise limitation on web and improving performance (~4x faster).
    • Fixed ObjectId.fromValues web support by replacing >> 32 with integer division in toProcessUniqueBytes.
    • Fixed Random.secure() fallback in FallbackProcessUnique to catch all exceptions, enabling Node.js compatibility.
    • Added CI pipeline with formatting, analysis, and tests on VM, Chrome, and Node.js.

    New Contributors

    Full Changelog: v4.0.1...v4.0.2

    Open source →
    Release notes
    • Rewrote ObjectId.fromHexString to parse hex directly into bytes, avoiding 32-bit bitwise limitation on web and improving performance (~4x faster).
    • Fixed ObjectId.fromValues web support by replacing >> 32 with integer division in toProcessUniqueBytes.
    • Fixed Random.secure() fallback in FallbackProcessUnique to catch all exceptions, enabling Node.js compatibility.
    • Added CI pipeline with formatting, analysis, and tests on VM, Chrome, and Node.js.
    Open source →
  3. 4.0.1 04 Jun 2025
    Release notes

    Changes

    • Removed deprecated implementation related to dart:js_util.
      • Process unique on the web platform is now based on Random.secured().

    Full Changelog: v4.0.0...v4.0.1

    Open source →
    Release notes
    • Removed deprecated implementation related to dart:js_util.
      • Process unique on the web platform is now based on Random.secured().
    Open source →
  4. 4.0.0 07 Mar 2025
    Release notes

    Changes

    • Migrated from deprecated dart:html to dart:js_util.

    Full Changelog: v.3.1.0...v4.0.0

    Open source →
    Release notes
    • Migration from deprecated dart:html to dart:js_util.
    Open source →
  5. 3.1.0 23 Sep 2024
    Release notes

    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

    Open source →
    Release notes
    • 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.
    Open source →
  6. 3.0.0 26 Jun 2023
    Release notes

    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

    Open source →
    Release notes
    • ⚠️ 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.
    Open source →
  7. 2.1.0 16 Mar 2022
    Release notes

    Changes

    • Constants ObjectId.byteLength and ObjectId.hexStringLength are now publicly available.
    Open source →
    Release notes
    • Constants ObjectId.byteLength and ObjectId.hexStringLength are now publicly available.
    Open source →
  8. 2.0.0 08 Apr 2021
    Release notes

    Changes:

    • Stable nullsafety release
    • Fixed a bug that caused the counter value to overflow at 0xfffffe.
      • Enabled counter overflow unit test.
    • toString method now instead of runtimeType(hexString), returns objectid's hexString.
      /// Before:
      print(ObjectId()) // => "ObjectId(606eed9d7203bfbbb7fffffe)"
      /// Now:
      print(ObjectId()) // => "606eed9d7203bfbbb7fffffe"
      TIP:
      If you still want to use the toString method with runtimeType, you can override the ObjectId class. Example:
      class MyObjectId extends ObjectId {
        @override
        String toString() => '$runtimeType($hexString)';
      }
    Open source →
    Release notes
    • Stable nullsafety release
    • Fixed a bug that caused the counter value to overflow at 0xfffffe.
      • Enabled counter overflow unit test.
    • toString method now instead of runtimeType(hexString), returns objectid's hexString.
      /// Before:
      print(ObjectId()) // => "ObjectId(606eed9d7203bfbbb7fffffe)"
      /// Now:
      print(ObjectId()) // => "606eed9d7203bfbbb7fffffe"
      
      TIP:
      If you still want to use the toString method with runtimeType, you can override the ObjectId class. Example:
      class MyObjectId extends ObjectId {
        @override
        String toString() => '$runtimeType($hexString)';
      }
      
    Open source →
  9. 2.0.0-nullsafety.0 23 Feb 2021 pre-release
    Release notes

    Changes:

    • Initial move towards null safety
    • Updated changelog (removed release dates)
    Open source →
    Release notes
    • Initial move towards nullsafety
    • Updated changelog (removed release dates)
    Open source →
  10. 1.1.1 05 Sep 2020
    Release notes
    • Use StringBuffer instead of String class for hexString generation (almost 5 times faster generation of hexStrings).
    Open source →
  11. 1.1.0 05 Sep 2020
    Release notes
    • Migrate package to effective dart style.
    • 100% tests coverage.
    • Improve readme docs.
      • Added badges.
      • Added benchmark section.
    Open source →
  12. 1.0.0 05 Sep 2020
    Release notes
    • Added readme documentation
    Open source →
  13. 0.2.0 04 Sep 2020
    Release notes
    • Added unit tests
    • Restructured projects
    • Added fromBytes, fromValues and fromTimestamp constructors.
    • Renamed generationTime property to timestamp.
    • Added missing hashCode implementation based on murmurHash2.
    • Added bytes property.
    Open source →
  14. 0.1.0-dev.1 04 Sep 2020 pre-release
    Release notes
    • Added ObjectId class.
      • Added ObjectId() and ObjectId.fromHexString() constructors.
      • Added isValid helper method.
      • Added equality operator overload ==.
      • Added hexString and generationTime getters with caching support.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive