Skip to content

Commit

Permalink
Add validation disable
Browse files Browse the repository at this point in the history
  • Loading branch information
daegalus committed Mar 22, 2021
1 parent 53e6fef commit 43c74fb
Show file tree
Hide file tree
Showing 38 changed files with 345 additions and 316 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.0.2

* Add flags to UuidValue constructor and parse to disable validation of the UUID, primarily to allow Microsoft GUIDs to not break things.

v3.0.1

* Fix RNG to not need shuffling and improve performance/memory usage (Thanks @julemand101)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub.dartlang.org: (you can use 'any' instead of a version if you just want the l

```yaml
dependencies:
uuid: 3.0.1
uuid: 3.0.2
```
```dart
Expand Down Expand Up @@ -282,6 +282,7 @@ Parse and unparse UUIDs
* `id` - (String) UUID(-like) string
* `buffer` - (List) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used
* `offset` - (Int | Number) Starting index in `buffer` at which to begin writing. Default: 0
* `validate` - (bool, default: true) Allows you to disable UUID validation, mostly useful for Microsoft GUID nonsense.

**Throws**:
parse() -> FormatException - when not a valid UUID
Expand Down
2 changes: 1 addition & 1 deletion docs/__404error.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>404: Something's gone wrong :-(</h1>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h3 id="pubspec">Pubspec</h3>
<p>There are 2 options. Directly from git, or from pub.dartlang.org</p>
<p>pub.dartlang.org: (you can use 'any' instead of a version if you just want the latest always)</p>
<pre class="language-yaml"><code class="language-yaml">dependencies:
uuid: 3.0.1
uuid: 3.0.2
</code></pre>
<pre class="language-dart"><code class="language-dart">import 'package:uuid/uuid.dart';

Expand Down Expand Up @@ -296,6 +296,7 @@ <h3 id="uuidunparselistint-buffer-int-offset-0---string">uuid.unparse(List<int>
<li><code>id</code> - (String) UUID(-like) string</li>
<li><code>buffer</code> - (List) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used</li>
<li><code>offset</code> - (Int | Number) Starting index in <code>buffer</code> at which to begin writing. Default: 0</li>
<li><code>validate</code> - (bool, default: true) Allows you to disable UUID validation, mostly useful for Microsoft GUID nonsense.</li>
</ul>
<p><strong>Throws</strong>:
parse() -&gt; FormatException - when not a valid UUID
Expand Down Expand Up @@ -370,7 +371,7 @@ <h2>Libraries</h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
95 changes: 48 additions & 47 deletions docs/uuid/Uuid-class.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/uuid/Uuid/NAMESPACE_DNS-constant.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -104,7 +104,7 @@ <h5>Uuid class</h5>
</h1></div>

<section class="multi-line-signature">
<span class="returntype"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>
<span class="returntype"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>
const <span class="name ">NAMESPACE_DNS</span>

</section>
Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
14 changes: 7 additions & 7 deletions docs/uuid/Uuid/NAMESPACE_NIL-constant.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -104,7 +104,7 @@ <h5>Uuid class</h5>
</h1></div>

<section class="multi-line-signature">
<span class="returntype"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>
<span class="returntype"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>
const <span class="name ">NAMESPACE_NIL</span>

</section>
Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
14 changes: 7 additions & 7 deletions docs/uuid/Uuid/NAMESPACE_OID-constant.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -104,7 +104,7 @@ <h5>Uuid class</h5>
</h1></div>

<section class="multi-line-signature">
<span class="returntype"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>
<span class="returntype"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>
const <span class="name ">NAMESPACE_OID</span>

</section>
Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
14 changes: 7 additions & 7 deletions docs/uuid/Uuid/NAMESPACE_URL-constant.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -104,7 +104,7 @@ <h5>Uuid class</h5>
</h1></div>

<section class="multi-line-signature">
<span class="returntype"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>
<span class="returntype"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>
const <span class="name ">NAMESPACE_URL</span>

</section>
Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
14 changes: 7 additions & 7 deletions docs/uuid/Uuid/NAMESPACE_X500-constant.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -104,7 +104,7 @@ <h5>Uuid class</h5>
</h1></div>

<section class="multi-line-signature">
<span class="returntype"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>
<span class="returntype"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>
const <span class="name ">NAMESPACE_X500</span>

</section>
Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
14 changes: 7 additions & 7 deletions docs/uuid/Uuid/Uuid.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ <h5>Uuid class</h5>
<li class="section-title">
<a href="../../uuid/Uuid-class.html#instance-properties">Properties</a>
</li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/hashCode.html">hashCode</a></li>
<li><a href="../../uuid/Uuid/options.html">options</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/runtimeType.html">runtimeType</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="../../uuid/Uuid-class.html#instance-methods">Methods</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/toString.html">toString</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/toString.html">toString</a></li>
<li><a href="../../uuid/Uuid/v1.html">v1</a></li>
<li><a href="../../uuid/Uuid/v1buffer.html">v1buffer</a></li>
<li><a href="../../uuid/Uuid/v1obj.html">v1obj</a></li>
Expand All @@ -80,7 +80,7 @@ <h5>Uuid class</h5>
<li><a href="../../uuid/Uuid/v5obj.html">v5obj</a></li>

<li class="section-title inherited"><a href="../../uuid/Uuid-class.html#operators">Operators</a></li>
<li class="inherited"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Object/operator_equals.html">operator ==</a></li>
<li class="inherited"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html">operator ==</a></li>



Expand All @@ -105,7 +105,7 @@ <h5>Uuid class</h5>

<section class="multi-line-signature">
const
<span class="name ">Uuid</span>(<wbr><ol class="parameter-list"><li><span class="parameter" id="-param-options">{<span class="type-annotation"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/Map-class.html">Map</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.dart.dev/beta/2.12.0-259.12.beta/dart-core/String-class.html">String</a></span>, <span class="type-parameter">dynamic</span>&gt;</span>?</span> <span class="parameter-name">options</span>}</span></li>
<span class="name ">Uuid</span>(<wbr><ol class="parameter-list"><li><span class="parameter" id="-param-options">{<span class="type-annotation"><a href="https://api.dart.dev/stable/2.12.2/dart-core/Map-class.html">Map</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.dart.dev/stable/2.12.2/dart-core/String-class.html">String</a></span>, <span class="type-parameter">dynamic</span>&gt;</span>?</span> <span class="parameter-name">options</span>}</span></li>
</ol>)
</section>

Expand All @@ -125,7 +125,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
uuid
3.0.1
3.0.2
</span>

</footer>
Expand Down
Loading

0 comments on commit 43c74fb

Please sign in to comment.