uuid static method

String uuid()

Generates a random UUID-like string

Example:

Helpers.uuid(); // '550e8400-e29b-41d4-a716-446655440000'

Implementation

static String uuid() {
  final random = Random();
  return '${_hex(random.nextInt(0x100000000), 8)}-'
      '${_hex(random.nextInt(0x10000), 4)}-'
      '${_hex(random.nextInt(0x10000), 4)}-'
      '${_hex(random.nextInt(0x10000), 4)}-'
      '${_hex(random.nextInt(0x1000000000000), 12)}';
}