aboutsummaryrefslogtreecommitdiff
path: root/toys/other/uuidgen.c
blob: 4cfebe998015cc13ea4df072b66f490d72bcb441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* uuidgen.c - Create a new random UUID
 *
 * Copyright 2018 The Android Open Source Project
 *
 * UUID RFC: https://tools.ietf.org/html/rfc4122

USE_UUIDGEN(NEWTOY(uuidgen, ">0r(random)", TOYFLAG_USR|TOYFLAG_BIN))

config UUIDGEN
  bool "uuidgen"
  default y
  help
    usage: uuidgen

    Create and print a new RFC4122 random UUID.
*/

#define FOR_uuidgen
#include "toys.h"

void uuidgen_main(void)
{
  create_uuid(toybuf);
  puts(show_uuid(toybuf));
}