anchor.diff:                          (char-to-digit (char string (1+ j)))))
            finally (return key)))))
   
  -(defun byte-array-to-hex-string (vector &key (start 0) end (element-type 'base-char))
  +(defun byte-array-to-hex-string (vector &aux (start 0) (end (length vector)) (element-type 'base-char))
     "Return a string containing the hexadecimal representation of the
   subsequence of VECTOR between START and END.  ELEMENT-TYPE controls
   the element-type of the returned string."
  
positive.code:                 for j from (1- end) downto start
                  sum (ash (aref octet-vec j) (* i 8)))))))
  
  (defun integer-to-octets (bignum &key (n-bits (integer-length bignum))
                                  (big-endian t))
    (let* ((n-bytes (ceiling n-bits 8))
           (octet-vec (make-array n-bytes :element-type '(unsigned-byte 8))))
      (declare (type (simple-array (unsigned-byte 8) (*)) octet-vec))
  
negative.code:            (type fixnum start)
             (type (or cl:null fixnum) end)
             (optimize (speed 3) (safety 1)))
    (let* ((length (- end start))
           (hexdigits #.(coerce "0123456789abcdef" 'simple-base-string)))
      (loop with string = (ecase element-type
                            ;; so that the compiler optimization can jump in
  