Giter Site home page Giter Site logo

Comments (5)

daegalus avatar daegalus commented on May 30, 2024

I'll need more info, as my manipulations stick to 32bit and below. What's the actual error or problem?

from dart-uuid.

sj0000e avatar sj0000e commented on May 30, 2024

uuid: ^4.3.2

void main() {
  print(const Uuid().v7());
  print(const Uuid().v7());
}

I wanted to use UUID v7, generate them on multiple machines, and sort them chronologically,
javascript version generated an invalid ke, so I couldn't sort chronologically.

<javascript>
f3b80000-2d78-7e3e-9214-d7b3935cab87
f3b80000-2d79-7fee-9238-9c2a18c4d2f1

<macOs>
flutter: 018cf3b7-9411-7ebf-bdc2-bf9e957ac16f
flutter: 018cf3b7-942d-7673-88ef-5abe52ba7c14

from dart-uuid.

daegalus avatar daegalus commented on May 30, 2024

Hmm, I'll have to do some testing. Also make sure you are taking timezones into account. But this does look truncated.

I'll do some testing today and figure it out.

Here is how to adjust timezones in dart

import 'package:timezone/data/latest.dart' as timezone;
import 'package:timezone/timezone.dart' as timezone;

....

  final now = DateTime.now();
  timezone.initializeTimeZones();

  final pacificTimeZone = timezone.getLocation('America/Los_Angeles');
  final date = timezone.TZDateTime.from(now, pacificTimeZone);

from dart-uuid.

daegalus avatar daegalus commented on May 30, 2024

Ok, I can confirm it's truncation. I fixed it for v7 but found a related bug in v6. But it's trickier to fix, but I should have a new version with fixes soon

from dart-uuid.

daegalus avatar daegalus commented on May 30, 2024

fixed in 4.3.3

from dart-uuid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.