aboutsummaryrefslogtreecommitdiff
path: root/ms_core/system_id.v
blob: 4413b757f0386bd4a405fb7e898569301519bc63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ms_core

import crypto.rand

pub struct SystemId {
mut:
	base [16]u8
}

pub fn get_new_system_id() !SystemId {
	bytes := rand.bytes(16) or { panic('Could not retireve 16 randrom bytes for system_id!') }
	mut base := [16]u8{}
	copy(mut base, bytes)
	return SystemId{
		base: base
	}
}