blowfish fixes

This commit is contained in:
erana 2012-01-20 15:10:29 +09:00
parent a315031128
commit ec1faec15a
1 changed files with 9 additions and 7 deletions

View File

@ -1071,13 +1071,15 @@
(let ((colornumber 0))
(do ((i (- (string-length sy) 1) (- i 1)))
((< i 0) (- colornumber 1))
(let ((c (string-ref (string sy) i)))
(let ((c (string-ref (if (number? sy)
(number->string sy)
(symbol->string sy)) i)))
(let ((n (cond ((or (eq? c #\a)(eq? c #\A))
10)
((or (eq? c #\b)(eq? c #\B))
11)
((or (eq? c #\c)(eq? c #\C))
12)
10)
((or (eq? c #\b)(eq? c #\B))
11)
((or (eq? c #\c)(eq? c #\C))
12)
((or (eq? c #\d)(eq? c #\D))
13)
((or (eq? c #\e)(eq? c #\E))
@ -1085,7 +1087,7 @@
((or (eq? c #\f)(eq? c #\F))
15)
(else (string->number (string c))))))
(set! colornumber (+ (* (+ n 1) 16 i) colornumber)))))))
(set! colornumber (+ (* (+ n 1) 16 i) colornumber)))))))
(define :blowfish-record