Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: packages/usage/lib/src/uuid.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/usage/lib/src/usage_impl_io.dart ('k') | packages/usage/lib/usage.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/lib/src/uuid.dart
diff --git a/packages/usage/lib/uuid/uuid.dart b/packages/usage/lib/src/uuid.dart
similarity index 58%
rename from packages/usage/lib/uuid/uuid.dart
rename to packages/usage/lib/src/uuid.dart
index eaafeb2f1f742683d4dc7df8fcaa87002845a3ec..66e99acafb0f0a242b75899f0597e39789aad022 100644
--- a/packages/usage/lib/uuid/uuid.dart
+++ b/packages/usage/lib/src/uuid.dart
@@ -2,30 +2,36 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// A UUID generator library.
-library uuid;
+/**
+ * A UUID generator library.
+ */
+library usage.uuid;
import 'dart:math' show Random;
-/// A UUID generator.
-///
-/// This will generate unique IDs in the format:
-///
-/// f47ac10b-58cc-4372-a567-0e02b2c3d479
-///
-/// The generated uuids are 128 bit numbers encoded in a specific string format.
-/// For more information, see
-/// [en.wikipedia.org/wiki/Universally_unique_identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier).
+/**
+ * A UUID generator. This will generate unique IDs in the format:
+ *
+ * f47ac10b-58cc-4372-a567-0e02b2c3d479
+ *
+ * The generated uuids are 128 bit numbers encoded in a specific string format.
+ *
+ * For more information, see
+ * http://en.wikipedia.org/wiki/Universally_unique_identifier.
+ */
class Uuid {
- final Random _random = new Random();
+ Random _random = new Random();
- /// Generate a version 4 (random) uuid. This is a uuid scheme that only uses
- /// random numbers as the source of the generated uuid.
+ /**
+ * Generate a version 4 (random) uuid. This is a uuid scheme that only uses
+ * random numbers as the source of the generated uuid.
+ */
String generateV4() {
// Generate xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx / 8-4-4-4-12.
int special = 8 + _random.nextInt(4);
- return '${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}-'
+ return
+ '${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}-'
'${_bitsDigits(16, 4)}-'
'4${_bitsDigits(12, 3)}-'
'${_printDigits(special, 1)}${_bitsDigits(12, 3)}-'
« no previous file with comments | « packages/usage/lib/src/usage_impl_io.dart ('k') | packages/usage/lib/usage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698