Skip to content

Commit c4574ec

Browse files
committed
Release 2.1
1 parent 76e4ef1 commit c4574ec

File tree

11 files changed

+50
-101
lines changed

11 files changed

+50
-101
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dart:
44
- dev
55
dart_task:
66
- test: --platform vm
7-
- test: --platform firefox -j 1
7+
- test: --platform chrome
88
- dartanalyzer: --fatal-warnings --fatal-lints lib
99
branches:
1010
only: [master]

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
## 2.1.0
3+
Minimal Dart v.3.3 dependency
4+
5+
### Changed
6+
- `TimeUuidGenerator.nodeId` is changed from `UnmodifiableUint8ListView` to read-only `Uint8List`
7+
28
## 2.0.0
39
Stable null safety release
410

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018-2019 Denis Portnov <denixport@gmail.com
3+
Copyright (c) 2024 Denis Portnov
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,22 @@ and supports generation, parsing and formatting of UUIDs.
1010
Features:
1111
* [x] Creates UUID from string and byte-array, as well as GUID and URN strings
1212
* [x] Provides access to variant, version and byte data of UUID
13-
* [x] Generates RFC4122 time-based v1, random-based v4, and namespace & name-based v5 UUIDs
13+
* [x] Generates RFC4122 version 1, version 4, or version 5 UUIDs
1414
* [x] Implements `Comparable` for UUID comparison and lexicographical sorting
15-
* [x] Runs on Dart VM and in browser
15+
* [x] Runs in web, server, and flutter
1616

17-
RFC 4122 Version support:
18-
- [x] v1, based on timestamp and MAC address (RFC 4122)
17+
RFC Version support:
18+
- [x] v1, based on timestamp and MAC address
1919
- [ ] v2, based on timestamp, MAC address and POSIX UID/GID (DCE 1.1) **Not planned**
20-
- [ ] v3, based on MD5 hashing (RFC 4122) **Not planned**
21-
- [x] v4, based on random numbers (RFC 4122)
22-
- [x] v5, based on SHA-1 hashing (RFC 4122)
20+
- [ ] v3, based on MD5 hashing **Not planned**
21+
- [x] v4, based on random numbers
22+
- [x] v5, based on SHA-1 hashing
23+
- [ ] v6, A re-ordering of UUID version 1 so it is sortable as an opaque sequence of bytes
24+
- [ ] v7, An entirely new time-based UUID bit layout sourced from the widely implemented and well known Unix Epoch timestamp source
25+
- [ ] v8, A free-form UUID format which has no explicit requirements except maintaining backward compatibility.
2326

2427
## Requirements
25-
- Dart SDK >- 2.12.0
28+
- Dart SDK >= 2.12.0
2629
- `crypto` package
2730

2831
## Getting Started
@@ -31,7 +34,7 @@ RFC 4122 Version support:
3134
1. Add an entry in your `pubspec.yaml` for `uuid_type`
3235
```yaml
3336
dependencies:
34-
uuid_type: ^2.0.0
37+
uuid_type: ^2.1.0
3538
```
3639
2. Run `pub get` (`flutter packages get` for Flutter)
3740
3. Import
@@ -65,5 +68,4 @@ See [CHANGELOG](CHANGELOG.md)
6568
## Features and Bugs
6669
Please file bugs and feature requests at the [issue tracker][tracker].
6770

68-
6971
[tracker]: https://github.com/denixport/dart-uuid/issues

analysis_options.yaml

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,13 @@
1-
include: package:pedantic/analysis_options.yaml
1+
include: package:lints/recommended.yaml
2+
23
analyzer:
3-
strong-mode:
4-
implicit-casts: false
5-
implicit-dynamic: false
6-
errors:
7-
dead_code: error
8-
missing_required_param: error
9-
missing_return: error
10-
omit_local_variable_types: info
11-
prefer_single_quotes: info
12-
todo: ignore
13-
unused_element: error
14-
unused_import: error
15-
unused_local_variable: error
4+
language:
5+
strict-casts: true
6+
strict-inference: true
7+
strict-raw-types: true
168

179
linter:
1810
rules:
19-
- always_declare_return_types
20-
- always_require_non_null_named_parameters
21-
- annotate_overrides
22-
- avoid_empty_else
23-
- avoid_init_to_null
24-
- avoid_null_checks_in_equality_operators
25-
- avoid_relative_lib_imports
26-
- avoid_return_types_on_setters
27-
- avoid_shadowing_type_parameters
28-
- avoid_types_as_parameter_names
29-
- await_only_futures
30-
- camel_case_extensions
31-
- camel_case_types
11+
- avoid_unused_constructor_parameters
3212
- cancel_subscriptions
33-
- comment_references
34-
- control_flow_in_finally
35-
- curly_braces_in_flow_control_structures
36-
- directives_ordering
37-
- empty_catches
38-
- empty_constructor_bodies
39-
- empty_statements
40-
- hash_and_equals
41-
- implementation_imports
42-
- iterable_contains_unrelated_type
43-
- library_names
44-
- library_prefixes
45-
- list_remove_unrelated_type
46-
- no_duplicate_case_values
47-
- non_constant_identifier_names
48-
- null_closures
49-
- overridden_fields
50-
- package_api_docs
51-
- prefer_adjacent_string_concatenation
52-
- prefer_collection_literals
53-
- prefer_conditional_assignment
54-
- prefer_contains
55-
- prefer_equal_for_default_values
56-
- prefer_final_fields
57-
- prefer_for_elements_to_map_fromIterable
58-
- prefer_generic_function_type_aliases
59-
- prefer_if_null_operators
60-
- prefer_is_empty
61-
- prefer_is_not_empty
62-
- prefer_iterable_whereType
63-
- prefer_spread_collections
64-
- public_member_api_docs
65-
- recursive_getters
66-
- slash_for_doc_comments
67-
- test_types_in_equals
68-
- throw_in_finally
69-
- type_init_formals
70-
- unawaited_futures
71-
- unnecessary_const
72-
- unnecessary_new
73-
- unnecessary_null_in_if_null_operators
74-
- unnecessary_this
75-
- unrelated_type_equality_checks
76-
- use_function_type_syntax_for_parameters
77-
- use_rethrow_when_possible
78-
- valid_regexps
13+
- package_api_docs

lib/src/generators.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Copyright (c) 2018-2021, Denis Portnov. All rights reserved.
1+
// Copyright (c) 2018-2024, Denis Portnov. All rights reserved.
22
// Released under MIT License that can be found in the LICENSE file.
33

44
library uuid_type.generators;
55

66
import 'dart:convert' show utf8;
77
import 'dart:math' show Random;
8-
import 'dart:typed_data' show Uint8List, UnmodifiableUint8ListView;
8+
import 'dart:typed_data' show Uint8List;
99

1010
import 'package:crypto/crypto.dart' show sha1;
1111

@@ -127,7 +127,7 @@ class TimeUuidGenerator {
127127
int get clockSequence => _clockSeq;
128128

129129
/// Returns Node ID for this generator
130-
UnmodifiableUint8ListView get nodeId => UnmodifiableUint8ListView(_nodeId);
130+
Uint8List get nodeId => _nodeId.asUnmodifiableView();
131131

132132
/// Generates UUID for current time
133133
Uuid generate() {

lib/src/util.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018-2021, Denis Portnov. All rights reserved.
1+
// Copyright (c) 2018-2024, Denis Portnov. All rights reserved.
22
// Released under MIT License that can be found in the LICENSE file.
33

44
library uuid_type.util;

lib/src/uuid.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018-2021, Denis Portnov. All rights reserved.
1+
// Copyright (c) 2018-2024, Denis Portnov. All rights reserved.
22
// Released under MIT License that can be found in the LICENSE file.
33

44
library uuid_type;

pubspec.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: uuid_type
22
description: UUID type, parser and generators. Can generate v1, v4, and v5 UUIDs
3-
version: 2.0.0
3+
version: 2.1.0
44
uploader: Denis Portnov <denixport@gmail.com>
5-
homepage: https://github.com/denixport/dart-uuid
5+
repository: https://github.com/denixport/dart-uuid
66
environment:
7-
sdk: '>=2.12.0 <3.0.0'
7+
sdk: ">=3.3.0 <4.0.0"
88
dependencies:
99
crypto: ^3.0.0
1010
dev_dependencies:
11-
test: ^1.16.8
12-
pedantic: ^1.11.0
11+
test: ^1.25.8
12+
lints: ^4.0.0
13+
topics:
14+
- uuid

test/generators_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ void main() {
8989
gi %= gens.length;
9090
}
9191
});
92+
93+
test('Node ID is not modifiable', () {
94+
expect(() => TimeUuidGenerator().nodeId[0] = 0, throwsA(TypeMatcher<UnsupportedError>()));
95+
});
9296
});
9397

9498
group('Random-based generator (v4)', () {

0 commit comments

Comments
 (0)