[PTRun][ValueGenerator]Add support for UUIDv7 (#35757)
Some checks are pending
Spell checking / Spell checking (push) Waiting to run
Spell checking / Report (Push) (push) Blocked by required conditions
Spell checking / Report (PR) (push) Blocked by required conditions
Spell checking / Update PR (push) Waiting to run

* add Run support for UUIDv7 generation

* simplify comments and maybe satisfy spell check

* fix endianess

* prefer stack allocation for temporary fixed-size buffer

* perhaps the async test caused the pipeline to hang

* switch to .NET 9 BCL implementation of UUIDv7

* add UUIDv7 to input query suggestions + update exception messages to include v7

* simplify Guid description switch + update devdocs
This commit is contained in:
Frederik Höft
2024-11-28 16:52:16 +01:00
committed by GitHub
parent 3dc491339a
commit fc29fc7426
9 changed files with 98 additions and 62 deletions

View File

@@ -1,6 +1,6 @@
# Value Generator Plugin
The Value Generator plugin is used to generate hashes for strings, to calculate base64 encodings, escape and encode URLs/URIs and to generate GUIDs versions 1, 3, 4 and 5.
The Value Generator plugin is used to generate hashes for strings, to calculate base64 encodings, escape and encode URLs/URIs and to generate GUIDs of version 1, 3, 4, 5, and 7.
![Image of Value Generator plugin](/doc/images/launcher/plugin/community.valuegenerator.png)
@@ -34,7 +34,10 @@ The Value Generator plugin is used to generate hashes for strings, to calculate
### [`GUIDGenerator`](/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Generators/GUID/GUIDGenerator.cs)
- Utility class for generating or calculating GUIDs
- Generating GUID versions 1 and 4 is done using builtin APIs. [`UuidCreateSequential`](https://learn.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidcreatesequential) for version 1 and `System.Guid.NewGuid()` for version 4
- Generating GUID versions 1, 4, and 7 is done using builtin APIs:
- [`UuidCreateSequential`](https://learn.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidcreatesequential) for version 1
- `System.Guid.NewGuid()` for version 4
- `System.Guid.CreateVersion7()` for version 7
- Versions 3 and 5 take two parameters, a namespace and a name
- The namespace must be a valid GUID or one of the [predefined ones](https://datatracker.ietf.org/doc/html/rfc4122#appendix-C)
- The `PredefinedNamespaces` dictionary contains aliases for the predefined namespaces