mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-05-06 04:02:57 +00:00
29 lines
428 B
Dart
29 lines
428 B
Dart
import 'DC.dart';
|
|
|
|
class UUID {
|
|
late DC _data;
|
|
|
|
UUID(this._data) {}
|
|
|
|
UUID.parse(String data) {
|
|
_data = DC.fromHex(data, '');
|
|
}
|
|
|
|
DC get value => _data;
|
|
|
|
bool operator ==(other) {
|
|
if (other is UUID)
|
|
return _data.sequenceEqual(other._data);
|
|
else
|
|
return false;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return _data.toHex('');
|
|
}
|
|
|
|
@override
|
|
int get hashCode => _data.toString().hashCode;
|
|
}
|