-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use enumerations instead of multiple separate definition of Namespace
Signed-off-by: bymoye <[email protected]>
- Loading branch information
Showing
7 changed files
with
23 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
// ignore_for_file: constant_identifier_names | ||
|
||
class Namespace { | ||
// RFC4122 provided namespaces for v3 and v5 namespace based UUIDs | ||
static const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; | ||
static const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; | ||
static const OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; | ||
static const X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; | ||
static const NIL = '00000000-0000-0000-0000-000000000000'; | ||
} | ||
import 'package:uuid/uuid_value.dart'; | ||
|
||
/// The options for UUID Validation strictness | ||
enum ValidationMode { nonStrict, strictRFC4122 } | ||
|
||
enum Namespace { | ||
// RFC4122 provided namespaces for v3 and v5 namespace based UUIDs | ||
DNS("6ba7b810-9dad-11d1-80b4-00c04fd430c8"), | ||
URL("6ba7b811-9dad-11d1-80b4-00c04fd430c8"), | ||
OID("6ba7b812-9dad-11d1-80b4-00c04fd430c8"), | ||
X500("6ba7b814-9dad-11d1-80b4-00c04fd430c8"), | ||
NIL("00000000-0000-0000-0000-000000000000"); | ||
|
||
const Namespace(this.value); | ||
final String value; | ||
|
||
UuidValue get uuidValue => UuidValue.raw(value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters