搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.0

sane_uuid

一個合理的 UUID 實現,支援根據 RFC4122 產生和處理 v1、v4 和 v5 UUID。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.4萬
喜歡數
4
Pub 分數
160

安裝套件

flutter pub add sane_uuid

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個乾淨簡潔的 Dart 與 Flutter UUID 庫,符合 RFC4122 標準。支援產生與解析版本 1、4 和 5 的 UUID,具備簡單直覺的 API。專為所有主要平台設計,確保在需要唯一識別碼的應用程式中一致處理 UUID。此套件強調清晰與正確,避免不必要的複雜性。

適用情境

  • 為使用者會話產生唯一ID
  • 在資料庫中建立永久識別碼
  • 實現安全令牌生成
  • 在設備間同步資料
  • 跨平台應用中的UUID處理

主要特色

  • 支援 UUID 版本 1、4 和 5
  • 符合 RFC4122
  • 簡單且易讀的 API
  • 跨平台相容性
  • 強大的解析和驗證
  • 輕量且無依賴

適合對象

  • 需要唯一識別碼的應用程式
  • 使用UUID的後端服務
  • 資料同步功能
  • 安全的身份驗證系統
  • 跨平台開發

使用建議

  • 不支援 UUID 版本 3
  • 僅限標準UUID格式
  • 除了解析之外,沒有內建的UUID驗證工具
  • 不適用於高效率批量UUID產生

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

sane_uuid

codecov

A properly designed, efficient UUID library for Dart.

  • Supports v1, v4, v5 and v6 generation
  • Immutable Uuid type with equality, comparison and accessors for properties defined by RFC 4122
    • The internal representation of the UUID is a byte array, not a String
  • Support for all syntactically correct UUIDs (regardless of RFC4122 semantics)

Usage

A simple usage example:

import 'package:sane_uuid/uuid.dart';

// randomly generated using secure random number generator
final Uuid randomUuid = Uuid.v4();
// Prints properly formatted UUID, e.g.: a8796ef4-8767-4cd0-b432-c5e93ba120df
print(randomUuid);

// parse any common UUID string
final parsedUuid = Uuid.fromString(
  'a8796ef4-8767-4cd0-b432-c5e93ba120df',
);

// hyphens and capitalization don't matter
final parsedUuidDifferentFormatting = Uuid.fromString(
    'A8796EF487674CD0B432C5E93BA120DF',
);

// UUID objects with the same data are actually equal
assert(parsedUuid == parsedUuidDifferentFormatting);

For more examples, see the examples page.

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

This project is released under the MIT License. That includes every file in this repository, unless explicitly stated otherwise at the top of a file. A copy of the license text can be found in the LICENSE file.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。