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

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

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers 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/usage_io.dart ('k') | packages/usage/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/lib/uuid/uuid.dart
diff --git a/packages/usage/lib/src/uuid.dart b/packages/usage/lib/uuid/uuid.dart
similarity index 58%
rename from packages/usage/lib/src/uuid.dart
rename to packages/usage/lib/uuid/uuid.dart
index 66e99acafb0f0a242b75899f0597e39789aad022..eaafeb2f1f742683d4dc7df8fcaa87002845a3ec 100644
--- a/packages/usage/lib/src/uuid.dart
+++ b/packages/usage/lib/uuid/uuid.dart
@@ -2,36 +2,30 @@
// 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 usage.uuid;
+/// A UUID generator library.
+library 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
- * 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
+/// [en.wikipedia.org/wiki/Universally_unique_identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier).
class Uuid {
- Random _random = new Random();
+ final 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/usage_io.dart ('k') | packages/usage/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698