Skip to content

Commit

Permalink
Release 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
denixport committed Mar 23, 2021
1 parent 43a2e40 commit 9c00e01
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 33 deletions.
62 changes: 42 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,59 @@
## Version 1

### 1.1.1
## 2.0.0
Stable null safety release

### Changed
- `bytes` getter replaced with `toBytes()` method
- Generators renamed
- `NameUuidGenerator` now has separate `generateFromString()` and `generateFromBytes()` methods

### Added
- `NameUuidGenerator` now has separate `generateFromString()` and `generateFromBytes()` methods

### Removed
- `Uuid()` constructor with string param
- `generate()` method from `NameUuidGenerator`

## 1.1.1
Small refactoring of time-based generator

### 1.1.0
Utility class for convinient UUID string generation and comparison
## 1.1.0

### 1.0.2
Release
### Added
Utility class for convenient UUID string generation and comparison

### 1.0.0-beta
## 1.0.2
Release

## 1.0.0-beta
More tests and documentation

## Beta
## 0.9.0-beta

### Added
- Abstract `Uuid` class now has `compareTo` method implemented

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

### 0.8.0-beta
- Refactored string parsing (does not affect API)
- Added comparison operators `>` `>=` `<` `<=`
## 0.8.0-beta

### Added
- Added comparison operators `>` `>=` `<` `<=`

### Changed
- Refactored string parsing

### 0.7.0-dev
- Dart 2.0 is a minimum required version
## 0.7.0-dev
- Dart 2.0 is a minimum required version

### 0.6.0-dev
- `toBytes()` method was renamed to `bytes` getter
## 0.6.0-dev
- `toBytes()` method was renamed to `bytes` getter

### 0.5.2-dev
## 0.5.2-dev
- Initial package documentation

### 0.5.1-dev
- Initial relase, and tests
## 0.5.1-dev
- Initial release, and tests
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# UUID type for Dart 2
# UUID type for Dart
[![Build Status](https://travis-ci.org/denixport/dart-uuid.svg?branch=master)](https://travis-ci.org/denixport/dart-uuid)
![Pub](https://img.shields.io/pub/vpre/uuid_type.svg)
![GitHub](https://img.shields.io/github/license/denixport/dart-uuid.svg)
Expand All @@ -22,16 +22,16 @@ RFC 4122 Version support:
- [x] v5, based on SHA-1 hashing (RFC 4122)

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

## Getting Started

### Installation
1. Add an entry in your `pubspec.yaml` for `uuid_type`
```yaml
dependencies:
uuid_type: ^1.0.0
uuid_type: ^2.0.0
```
2. Run `pub get` (`flutter packages get` for Flutter)
3. Import
Expand All @@ -40,7 +40,24 @@ import 'package:uuid_type/uuid_type.dart';
```

### Usage
[API](https://pub.dartlang.org/documentation/uuid_type/latest/)
Generate UUIDs
```dart
import 'package:uuid_type/uuid_type.dart';
void main() {
var u = TimeUuidGenerator().generate();
print(u.toString());
u = NameUuidGenerator(NameUuidGenerator.urlNamespace).generateFromString('https://dart.dev/');
print(u.toString());
u = RandomUuidGenerator().generate();
print(u.toString());
}
```

See more [examples](example/main.dart) and
[Documentation](https://pub.dartlang.org/documentation/uuid_type/latest/)

## Release notes
See [CHANGELOG](CHANGELOG.md)
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: uuid_type
description: 'UUID type, parser and generators. Can generate v1, v4, and v5 UUIDs'
version: 1.1.1
version: 2.0.0
uploader: Denis Portnov <[email protected]>
homepage: https://github.com/denixport/dart-uuid
environment:
sdk: '>=2.0.0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'
dependencies:
crypto: '>=2.0.0 <3.0.0'
crypto: '^3.0.0'
dev_dependencies:
test: '^1.3.0'
pedantic: ^1.4.0
test: '^1.16.0'
pedantic: ^1.9.0
4 changes: 2 additions & 2 deletions test/test_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const x500NsString = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';

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

final nilBytes = const <int>[
final nilBytes = l2b(<int>[
0x00, 0x00, 0x00, 0x00, //
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
] as Uint8List;
]);

final dnsNsBytes = l2b(<int>[
0x6B, 0xA7, 0xB8, 0x10, //
Expand Down
2 changes: 1 addition & 1 deletion test/uuid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void main() {
expect(Comparable.compare(newer, older) > 0, isTrue);

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

0 comments on commit 9c00e01

Please sign in to comment.