anchor.diff:  
   ;; Generate hmac for file
   (-> (io/input-stream "/tmp/somefile")
  -    (hmac/hmac "mysecretkey" :sha256)
  -    (bytes->hex))
  -;; -> "4cb793e600848da2053238003fce4c010233c49df3e6a04119b4287eb464c27e"
  -----
  -
  -You can extend it for your own types using `buddy.core.mac.hmac/HMac` protocol:
  +    (hmac/hash "mysecretkey" :sha256)
  +    (codecs/bytes->hex))
  +;; => "4cb793e600848da2053238003fce4c010233c49df3e6a04119b4287eb464c27e"
  +----
  +
  +
  +==== Advanced usage
  +
  +You can extend it for your own types using `buddy.core.mac.hmac/IHMac` protocol, that looks
  +like that one:
   
   [source,clojure]
   ----
  -(defprotocol HMac
  -  (make-hmac [data key algorithm]))
  +(defprotocol IHMac
  +  (hash* [data key algorithm])
  +  (verify* [data signature key alg]))
  +----
  +
  +
  +=== SHMac (Salted)
  +
  +
  +This is a salted variant of hmac algorithm and is available in *buddy.core.mac.shmac*
  +namespace.
  +
  +
  +==== Usage example
  +
  +[source, clojure]
  +----
  +;; Import required namespaces
  +(require '[buddy.core.mac.hmac :as shmac])
  +(require '[buddy.core.codecs :as codecs])
  +
  +;; Generate sha256 shmac over string
  +(-> (shmac/hash "foo bar" "salt" "mysecretkey" :sha256)
  +    (codecs/bytes->hex))
  +;; => "bd5f7a0040430a73f4845bac8f980c6398b4baae8a22efcc22038be0f4dd9678"
   ----
   
   
  
positive.code: `byte[]` and `java.lang.String`.
  
  
  ==== Advanced usage
  
  Like hash functions, hmac is implemented using Clojure
  protocols and comes with default implementations for: String, byte[],
  
negative.code: .Example using kdf1 or kdf2
  [source, clojure]
  ----
  (require '[buddy.core.codecs :as codecs])
  (require '[buddy.core.kdf :as kdf])
  
  ;; kdf1 and kdf2 are very similar and have the same
  ;; constructor signature. Requires: key data, salt
  ;; and hash algorithm keyword.
  
  (let [kfn (kdf/kdf2 (codecs/str->bytes "mysecretkey")
                      (codecs/str->bytes "mypublicsalt")
                      :sha256)]
    (-> (kdf/generate-byte-array! kfn 8)
        (codecs/bytes->hex)))
  
  ;; => "0faba553152fce4f"
  ----
  
  