Create a new hashing object and return it. key: bytes or buffer, The starting key for the hash. msg: bytes or buffer, Initial input for the hash, or None. digestmod: A hash name suitable for hashlib.new(). *OR* A hashlib constructor returning a new hash object. *OR*
(key, msg=None, digestmod='')
| 165 | return h.hexdigest() |
| 166 | |
| 167 | def new(key, msg=None, digestmod=''): |
| 168 | """Create a new hashing object and return it. |
| 169 | |
| 170 | key: bytes or buffer, The starting key for the hash. |
| 171 | msg: bytes or buffer, Initial input for the hash, or None. |
| 172 | digestmod: A hash name suitable for hashlib.new(). *OR* |
| 173 | A hashlib constructor returning a new hash object. *OR* |
| 174 | A module supporting PEP 247. |
| 175 | |
| 176 | Required as of 3.8, despite its position after the optional |
| 177 | msg argument. Passing it as a keyword argument is |
| 178 | recommended, though not required for legacy API reasons. |
| 179 | |
| 180 | You can now feed arbitrary bytes into the object using its update() |
| 181 | method, and can ask for the hash value at any time by calling its digest() |
| 182 | or hexdigest() methods. |
| 183 | """ |
| 184 | return HMAC(key, msg, digestmod) |
| 185 | |
| 186 | |
| 187 | def digest(key, msg, digest): |
no test coverage detected