require 'securerandom'
# Generate a UUID v4 (random-based) using Ruby's built-in SecureRandom module.
# SecureRandom.uuid:
# - Produces a fully RFC 4122–compliant UUID v4
# - Uses a cryptographically secure random number generator
# - Returns a lowercase string in canonical UUID format
#
# We wrap it in a function for clarity and reusability.
def generate_uuid_v4
SecureRandom.uuid.downcase # ensure lowercase output
end
# Main program
uuid = generate_uuid_v4
puts "Generated UUID v4: #{uuid}"
=begin
run:
Generated UUID v4: 72140285-2b67-45d0-a1cd-57fdc4c876d0
=end