@@ -23,7 +23,7 @@ Additionally, it adds the following functions:
2323* [ json_parse] ( #json_parse ) - Parse a JSON string into a JSON object
2424* [ sha256] ( #sha256 ) - Calculate the SHA-256 hash of a string
2525* [ sha512] ( #sha512 ) - Calculate the SHA-512 hash of a string
26- * [ uuid] ( #uuid ) - Generate a UUID
26+ * [ uuid] ( #uuid ) - Generate a UUID v5
2727* [ regex_test] ( #regex_test ) - Test if a string matches a regular expression
2828* [ regex_match] ( #regex_match ) - Return the first match of a regular expression in a string
2929* [ regex_match_all] ( #regex_match_all ) - Return all matches of a regular expression in a string
@@ -310,16 +310,26 @@ uuid(name?, namespace?)
310310` ` `
311311
312312**Description**:
313- Generates a UUID. If ` name` and (optionally) ` namespace` are provided, generates a version 5 UUID; otherwise, generates a version 4 UUID.
313+ Generates a version 5 UUID.
314+
315+ UUID v5 is consistent. It creates a UUID based on the SHA hash of the input. This means that any given combination
316+ of input and namespace will result in the same UUID, every time.
314317
315318**Example**:
316319` ` ` jmespath
317- uuid () // Random v4 UUID
318320uuid (' example' ) // v5 UUID
319321uuid (' example' , ' 6ba7b810-9dad-11d1-80b4-00c04fd430c8' ) // v5 UUID with namespace
320322` ` `
321323
322324` name` must be a string. Use ` json_serialize ()` to convert a JSON object to a string.
325+ ` namespace` must be a UUID string. By default, it uses the NIL UUID.
326+
327+ The UUID RFC pre-defines four namespaces
328+
329+ * NameSpace_DNS: ` 6ba7b810 - 9dad - 11d1 - 80b4 - 00c04fd430c8 `
330+ * NameSpace_URL: ` 6ba7b811 - 9dad - 11d1 - 80b4 - 00c04fd430c8 `
331+ * NameSpace_OID: ` 6ba7b812 - 9dad - 11d1 - 80b4 - 00c04fd430c8 `
332+ * NameSpace_X500: ` 6ba7b814 - 9dad - 11d1 - 80b4 - 00c04fd430c8 `
323333
324334### ` regex_test`
325335**Syntax**:
0 commit comments