]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - GenUUID/vtoy_gen_uuid.c
1 /******************************************************************************
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
32 unsigned char uuid
[16];
34 fd
= open("/dev/random", O_RDONLY
);
38 for (i
= 0; i
< 16; i
++)
40 uuid
[i
] = (unsigned char)(rand());
48 fwrite(uuid
, 1, 16, stdout
);