@@ -17,7 +17,7 @@ import (
1717
1818type hashFunc = func () stdhash.Hash
1919
20- func hash (hashFunc hashFunc , key []byte , bs []byte , encoding encoding.Encoding ) []byte {
20+ func hash (hashFunc hashFunc , bs []byte , key []byte , encoding encoding.Encoding ) []byte {
2121 h := hmac .New (hashFunc , key )
2222 h .Write (bs )
2323
@@ -27,31 +27,31 @@ func hash(hashFunc hashFunc, key []byte, bs []byte, encoding encoding.Encoding)
2727}
2828
2929// MD5 uses hmac-md5 to hash bs and returns an error if failed.
30- func MD5 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
31- return hash (md5 .New , key , bs , encoding )
30+ func MD5 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
31+ return hash (md5 .New , bs , key , encoding )
3232}
3333
3434// SHA1 uses hmac-sha1 to hash bs and returns an error if failed.
35- func SHA1 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
36- return hash (sha1 .New , key , bs , encoding )
35+ func SHA1 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
36+ return hash (sha1 .New , bs , key , encoding )
3737}
3838
3939// SHA224 uses hmac-sha224 to hash bs and returns an error if failed.
40- func SHA224 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
41- return hash (sha256 .New224 , key , bs , encoding )
40+ func SHA224 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
41+ return hash (sha256 .New224 , bs , key , encoding )
4242}
4343
4444// SHA256 uses hmac-sha256 to hash bs and returns an error if failed.
45- func SHA256 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
46- return hash (sha256 .New , key , bs , encoding )
45+ func SHA256 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
46+ return hash (sha256 .New , bs , key , encoding )
4747}
4848
4949// SHA384 uses hmac-sha384 to hash bs and returns an error if failed.
50- func SHA384 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
51- return hash (sha512 .New384 , key , bs , encoding )
50+ func SHA384 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
51+ return hash (sha512 .New384 , bs , key , encoding )
5252}
5353
5454// SHA512 uses hmac-sha512 to hash bs and returns an error if failed.
55- func SHA512 (key []byte , bs []byte , encoding encoding.Encoding ) []byte {
56- return hash (sha512 .New , key , bs , encoding )
55+ func SHA512 (bs []byte , key []byte , encoding encoding.Encoding ) []byte {
56+ return hash (sha512 .New , bs , key , encoding )
5757}
0 commit comments