From 3c51661bd806c11f2a6c1cd29b34637b9baec3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Tue, 7 Jul 2015 12:56:11 +0200 Subject: [PATCH 1/2] Add support for other implementations (flexi-streams dependency). --- md5.asd | 5 ++++- md5.lisp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/md5.asd b/md5.asd index 8cc1d5a..ec34697 100755 --- a/md5.asd +++ b/md5.asd @@ -15,5 +15,8 @@ :maintainer "Pierre R. Mai " :licence "Public Domain" :version "2.0.2" - #+sbcl :depends-on #+sbcl ("sb-rotate-byte") + :depends-on (#+sbcl "sb-rotate-byte" + #-(or :cmu :sbcl + (and :lispworks (not :lispworks4)) :ccl :allegro) + :flexi-streams) :components ((:file "md5"))) diff --git a/md5.lisp b/md5.lisp index b1dae39..bb54f59 100755 --- a/md5.lisp +++ b/md5.lisp @@ -711,7 +711,8 @@ determined by the underlying implementation." #-(or :cmu :sbcl (and :lispworks (not :lispworks4)) :ccl :allegro) (if (<= char-code-limit 256) (md5sum-sequence string :start start :end end) - (error "md5:md5sum-string is not supported for your implementation.")))) + (md5sum-sequence + (flexi-streams:string-to-octets string))))) (eval-when (:compile-toplevel :load-toplevel :execute) (defconstant +buffer-size+ (* 128 1024) From b7aace4262429c341bb0f15d341217ec3992e5f5 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 17 Jul 2015 22:30:56 +0200 Subject: [PATCH 2/2] Add support for external-format in flexi-streams variant. --- md5.asd | 5 +++-- md5.lisp | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/md5.asd b/md5.asd index ec34697..4829f27 100755 --- a/md5.asd +++ b/md5.asd @@ -17,6 +17,7 @@ :version "2.0.2" :depends-on (#+sbcl "sb-rotate-byte" #-(or :cmu :sbcl - (and :lispworks (not :lispworks4)) :ccl :allegro) - :flexi-streams) + (and :lispworks (not :lispworks4)) + :ccl :allegro) + "flexi-streams") :components ((:file "md5"))) diff --git a/md5.lisp b/md5.lisp index bb54f59..05ed5d9 100755 --- a/md5.lisp +++ b/md5.lisp @@ -712,7 +712,11 @@ determined by the underlying implementation." (if (<= char-code-limit 256) (md5sum-sequence string :start start :end end) (md5sum-sequence - (flexi-streams:string-to-octets string))))) + (flexi-streams:string-to-octets string + :external-format + (if (eq external-format :default) + :UTF-8 + external-format)))))) (eval-when (:compile-toplevel :load-toplevel :execute) (defconstant +buffer-size+ (* 128 1024)