picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 24de994780644b8dd63727a6bc548ebc866c7f19
parent 0489a090b5d500fe287118b9e39c66b9547be5d4
Author: Alexander Burger <abu@software-lab.de>
Date:   Mon, 25 Feb 2013 11:13:27 +0100

Factor 'randpw' from 'salt'
Diffstat:
Mlib/adm.l | 28+++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/lib/adm.l b/lib/adm.l @@ -1,4 +1,4 @@ -# 21feb13abu +# 25feb13abu # (c) Software Lab. Alexander Burger # *Salt *Login *Users *Perms @@ -7,18 +7,20 @@ (default *Salt (2 . "@1")) (de salt () - (text (cdr *Salt) - (make - (in "/dev/urandom" - (do (car *Salt) - (link - (get - '`(mapcar char - (conc - (range 46 57) - (range 65 90) - (range 97 122) ) ) - (& 63 (rd 1)) ) ) ) ) ) ) ) + (text (cdr *Salt) (randpw (car *Salt))) ) + +(de randpw (Len) + (make + (in "/dev/urandom" + (do Len + (link + (get + '`(mapcar char + (conc + (range 46 57) + (range 65 90) + (range 97 122) ) ) + (inc (& 63 (rd 1))) ) ) ) ) ) ) (de passwd (Str Salt) (if (and native *Salt)