Ayam Dobhal f3982278e8
feat(random uuid): add support for uuid versions other than 4. (#15239)
This PR implements the changes proposed in #15112 without any breaking
changes. Should close #15112 post the review.

# Description

Added functionality to generate `uuid` versions 1, 3, 4, 5, 7 instead of
just the version 4.
- Users can now add a `-v n` flag to specify the version of uuid they
want to generate and it maintains backward compatibility by returning a
v4 uuid by default if no flags are passed.
- Versions 3 and 5 have the additional but required namespace (`-s`) and
name (`-n`) arguments too. Version 1 requires a mac address (`-m`).
# User-Facing Changes
- Added support for uuid versions 1, 3, 5 and 7.
- For v3 and v5, the namespace and name arguments are required and hence
there will be an error if those are not passed. Similarly the mac
address for v1.
- Full backward compatibility by setting v4 as default.
# Tests + Formatting

Tests added:
in `nu-command::commands::random`
- generates_valid_uuid4_by_default
- generates_valid_uuid1
- generates_valid_uuid3_with_namespace_and_name
- generates_valid_uuid4
- generates_valid_uuid5_with_namespace_and_name
- generates_valid_uuid7
2025-03-06 14:21:52 +01:00
..
2025-01-28 16:03:31 -06:00
2025-01-28 16:03:31 -06:00
2025-01-28 16:03:31 -06:00
2022-11-22 16:58:11 -08:00
2025-02-10 15:32:05 +08:00
2024-05-23 02:05:27 +00:00
2024-05-23 02:05:27 +00:00
2023-10-24 12:48:05 -05:00
2025-01-28 16:03:31 -06:00
2024-10-11 06:43:12 -05:00
2025-02-06 06:56:30 -06:00
2025-01-30 18:27:55 -06:00
2025-01-04 16:41:03 -05:00
2024-05-03 08:36:10 +08:00
2025-02-25 12:09:52 -05:00
2025-01-28 16:03:31 -06:00
2024-12-18 06:36:04 -06:00
2025-02-25 12:09:52 -05:00
2025-02-12 20:03:40 -08:00
2025-01-27 18:23:44 -05:00
2025-01-28 16:03:31 -06:00
2024-12-03 20:45:31 -06:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2025-01-22 06:49:25 -06:00
2024-05-03 08:36:10 +08:00
2024-05-03 08:36:10 +08:00
2025-01-02 06:26:46 -06:00
2024-07-19 04:16:09 +00:00