Skip to contents

This function generates a persistent global identifier (UUID) for each record, which can be used as a unique identifier for Darwin Core records or other data.

Usage

generate_global_identifier(n = 1, namespace = NULL)

Arguments

n

Integer, the number of UUIDs to generate. Default is 1.

namespace

A character string representing a custom namespace. Default is NULL.

Value

A vector of UUIDs.

Examples

# Generate a single UUID
generate_global_identifier()
#> [1] "881afb8e-59b5-4860-8cb4-8eb4d3db7f30"

# Generate 5 UUIDs
generate_global_identifier(n = 5)
#> [1] "65a60a56-06c4-482a-8538-7ad1a44a68c6"
#> [2] "e96bef0a-9468-44bc-97b1-b5af9d40b9bd"
#> [3] "27dd16d9-f34b-48e5-bd1c-ed8d4ff6c068"
#> [4] "9f22527e-6f94-4769-b97c-17595ff85ff0"
#> [5] "5b92cab9-78a0-4406-89a2-8f2258328b1d"