cpdf_uuid_util.dart 640 B

123456789101112131415161718192021
  1. /*
  2. * Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  3. *
  4. * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  5. * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  6. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  7. * This notice may not be removed from this file.
  8. *
  9. */
  10. import 'dart:math';
  11. class CpdfUuidUtil {
  12. static String generateShortUniqueId() {
  13. final now = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  14. final random = Random().nextInt(1000);
  15. return '$now$random';
  16. }
  17. }