diff options
Diffstat (limited to 'ms_core/system_id.v')
| -rw-r--r-- | ms_core/system_id.v | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ms_core/system_id.v b/ms_core/system_id.v new file mode 100644 index 0000000..4413b75 --- /dev/null +++ b/ms_core/system_id.v @@ -0,0 +1,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 + } +} |
