Skip to content

Commit 9c00e01

Browse files
committed
Release 2.0
1 parent 43a2e40 commit 9c00e01

File tree

5 files changed

+72
-33
lines changed

5 files changed

+72
-33
lines changed

CHANGELOG.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
1-
## Version 1
21

3-
### 1.1.1
2+
## 2.0.0
3+
Stable null safety release
4+
5+
### Changed
6+
- `bytes` getter replaced with `toBytes()` method
7+
- Generators renamed
8+
- `NameUuidGenerator` now has separate `generateFromString()` and `generateFromBytes()` methods
9+
10+
### Added
11+
- `NameUuidGenerator` now has separate `generateFromString()` and `generateFromBytes()` methods
12+
13+
### Removed
14+
- `Uuid()` constructor with string param
15+
- `generate()` method from `NameUuidGenerator`
16+
17+
## 1.1.1
418
Small refactoring of time-based generator
519

6-
### 1.1.0
7-
Utility class for convinient UUID string generation and comparison
20+
## 1.1.0
821

9-
### 1.0.2
10-
Release
22+
### Added
23+
Utility class for convenient UUID string generation and comparison
1124

12-
### 1.0.0-beta
25+
## 1.0.2
26+
Release
27+
28+
## 1.0.0-beta
1329
More tests and documentation
1430

15-
## Beta
31+
## 0.9.0-beta
32+
33+
### Added
34+
- Abstract `Uuid` class now has `compareTo` method implemented
1635

17-
### 0.9.0-beta
36+
### Changed
1837
- Time-based generator is refactored to use `Stopwatch` instead of `DateTime` calls.
1938
Parameter `clockSequence` is now deprecated in `TimeBasedUuidGenerator` constructor
2039
- Comparison is refactored to treat v1 UUIDs differently
21-
- Abstract `Uuid` class now has `compareTo` method implemented
2240

23-
### 0.8.0-beta
24-
- Refactored string parsing (does not affect API)
25-
- Added comparison operators `>` `>=` `<` `<=`
41+
## 0.8.0-beta
42+
43+
### Added
44+
- Added comparison operators `>` `>=` `<` `<=`
45+
46+
### Changed
47+
- Refactored string parsing
2648

27-
### 0.7.0-dev
28-
- Dart 2.0 is a minimum required version
49+
## 0.7.0-dev
50+
- Dart 2.0 is a minimum required version
2951

30-
### 0.6.0-dev
31-
- `toBytes()` method was renamed to `bytes` getter
52+
## 0.6.0-dev
53+
- `toBytes()` method was renamed to `bytes` getter
3254

33-
### 0.5.2-dev
55+
## 0.5.2-dev
3456
- Initial package documentation
3557

36-
### 0.5.1-dev
37-
- Initial relase, and tests
58+
## 0.5.1-dev
59+
- Initial release, and tests

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# UUID type for Dart 2
1+
# UUID type for Dart
22
[![Build Status](https://travis-ci.org/denixport/dart-uuid.svg?branch=master)](https://travis-ci.org/denixport/dart-uuid)
33
![Pub](https://img.shields.io/pub/vpre/uuid_type.svg)
44
![GitHub](https://img.shields.io/github/license/denixport/dart-uuid.svg)
@@ -22,16 +22,16 @@ RFC 4122 Version support:
2222
- [x] v5, based on SHA-1 hashing (RFC 4122)
2323

2424
## Requirements
25-
- Dart 2 (tested with >=2.0.0). Should also work with Dart 1.24, but not tested.
26-
- `crypto` package to generate name based UUIDs
25+
- Dart SDK >- 2.12.0
26+
- `crypto` package
2727

2828
## Getting Started
2929

3030
### Installation
3131
1. Add an entry in your `pubspec.yaml` for `uuid_type`
3232
```yaml
3333
dependencies:
34-
uuid_type: ^1.0.0
34+
uuid_type: ^2.0.0
3535
```
3636
2. Run `pub get` (`flutter packages get` for Flutter)
3737
3. Import
@@ -40,7 +40,24 @@ import 'package:uuid_type/uuid_type.dart';
4040
```
4141

4242
### Usage
43-
[API](https://pub.dartlang.org/documentation/uuid_type/latest/)
43+
Generate UUIDs
44+
```dart
45+
import 'package:uuid_type/uuid_type.dart';
46+
47+
void main() {
48+
var u = TimeUuidGenerator().generate();
49+
print(u.toString());
50+
51+
u = NameUuidGenerator(NameUuidGenerator.urlNamespace).generateFromString('https://dart.dev/');
52+
print(u.toString());
53+
54+
u = RandomUuidGenerator().generate();
55+
print(u.toString());
56+
}
57+
```
58+
59+
See more [examples](example/main.dart) and
60+
[Documentation](https://pub.dartlang.org/documentation/uuid_type/latest/)
4461

4562
## Release notes
4663
See [CHANGELOG](CHANGELOG.md)

pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: uuid_type
22
description: 'UUID type, parser and generators. Can generate v1, v4, and v5 UUIDs'
3-
version: 1.1.1
3+
version: 2.0.0
44
uploader: Denis Portnov <denixport@gmail.com>
55
homepage: https://github.com/denixport/dart-uuid
66
environment:
7-
sdk: '>=2.0.0 <3.0.0'
7+
sdk: '>=2.12.0 <3.0.0'
88
dependencies:
9-
crypto: '>=2.0.0 <3.0.0'
9+
crypto: '^3.0.0'
1010
dev_dependencies:
11-
test: '^1.3.0'
12-
pedantic: ^1.4.0
11+
test: '^1.16.0'
12+
pedantic: ^1.9.0

test/test_data.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const x500NsString = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
1313

1414
var x = <int>[1, 2, 3] as Uint8List;
1515

16-
final nilBytes = const <int>[
16+
final nilBytes = l2b(<int>[
1717
0x00, 0x00, 0x00, 0x00, //
1818
0x00, 0x00,
1919
0x00, 0x00,
2020
0x00, 0x00,
2121
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
22-
] as Uint8List;
22+
]);
2323

2424
final dnsNsBytes = l2b(<int>[
2525
0x6B, 0xA7, 0xB8, 0x10, //

test/uuid_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void main() {
9797
expect(Comparable.compare(newer, older) > 0, isTrue);
9898

9999
// same timestamp compared in lexicographical order
100-
final ua = Uuid.parse('00000000-1234-4235-8000-000000000000');
100+
final ua = Uuid.parse('00000000-1233-4235-8000-000000000000');
101101
final ub = Uuid.parse('00000000-1234-4234-8000-000000000000');
102102
expect(Comparable.compare(ua, ub) > 0, isFalse);
103103
});

0 commit comments

Comments
 (0)