Big code refactor, get rid of HAL entirely

This commit is contained in:
2025-11-11 21:26:27 +01:00
parent 7015bc9576
commit 566b35f4d5
84 changed files with 477 additions and 520 deletions

View File

@ -1,9 +1,8 @@
#include <stdint.h>
#include <stddef.h>
#include "uniqid.h"
#include "atomic.h"
#include "randcrypto/uniqid.h"
#include "randcrypto/physrand.h"
#include "spinlock/spinlock.h"
#include "hal/hal.h"
static const char *base62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@ -28,7 +27,7 @@ void uniqseed(void) {
return;
uint32_t seed = 0;
int32_t r = hal_randnum();
int32_t r = randcrypto_get_physrand();
if (r != -1) {
seed = (uint32_t)r;
} else {
@ -48,7 +47,7 @@ void randcrypto_gen_uniqid(char *out, size_t n) {
uniqseed();
int32_t r = hal_randnum();
int32_t r = randcrypto_get_physrand();
uint32_t extra = (r != -1) ? (uint32_t)r : uniqstate * 0x27d4eb2dU;
uniqstate += 0x9E3779B1u;