NRK wrote:
> I'd recommend using the bitmask approach described in here:
> https://www.pcg-random.org/posts/bounded-rands.html#bitmask-with-rejection-unbiased-apples-method
I thought the approach used by OpenBSD was simpler, and performed better,
becaused it avoided the loop, which might cause th
libutil/random.c now includes a custom PRNG, which is the PCG family.
It also overhauls random_uniform(), making it way faster. Names were
changed (s/random/rng32/g), and reentrant versions added.
The PRNG is faster than libc's random().
It is way faster than the previous version, which used
---
l
---
shuf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shuf.c b/shuf.c
index 36b3898..21210de 100644
--- a/shuf.c
+++ b/shuf.c
@@ -47,11 +47,11 @@ main(int argc, char *argv[])
}
}
- random_seed();
+ rng32_seed();
if (!rf
---
cron.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cron.c b/cron.c
index 126ebf1..e95c661 100644
--- a/cron.c
+++ b/cron.c
@@ -294,7 +294,7 @@ parserange(char *str, long low, long high, struct range *r)
if (random) {
/* random replaces low in
decomp() needs the force flag -f too.
---
tar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tar.c b/tar.c
index 5f73c26..0361b63 100644
--- a/tar.c
+++ b/tar.c
@@ -593,7 +593,7 @@ main(int argc, char *argv[])
if (filtertool) {
fd =
It was already mentioned in Dec 2016 here:
https://lists.suckless.org/dev/1612/30852.html
but never fixed since.
*Extracting* long paths was added in May 2022 here:
https://lists.suckless.org/hackers/2205/18321.html
but not *archiving*.
Next thing to do should be supporting links while archiving.
On Sun, Mar 03, 2024 at 03:05:47PM +0100, Eolien55 wrote:
> but should we not rather implement "Debiased Int Mult (t-opt)"?
Both should be fine. The integer mul method avoids clz() so that could
be a reason to prefer it.
> arc4random(3) doesn't uses seeds, which means that I cannot initialize
> i