Re: [hackers] Re: [sbase] Orphan patches and unsent patches

2024-03-03 Thread Eolien55
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

[hackers] [sbase][PATCH] libutil/random: rewrite whole algorithm

2024-03-03 Thread Elie Le Vaillant
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

[hackers] [sbase][PATCH] shuf: use new libutil/random

2024-03-03 Thread Elie Le Vaillant
--- 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

[hackers] [sbase][PATCH] cron: use new libutil/random

2024-03-03 Thread Elie Le Vaillant
--- 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

[hackers] [sbase][PATCH] tar: force decompression

2024-03-03 Thread Elie Le Vaillant
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 =

[hackers] [sbase] tar: fix long names crashing tar archiving

2024-03-03 Thread Andrea Calligaris
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.

Re: [hackers] Re: [sbase] Orphan patches and unsent patches

2024-03-03 Thread NRK
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