Method
hmac
(request, secret, algorithm=hashlib.sha256, digest='hex')
Source from the content-addressed store, hash-verified
| 1389 | |
| 1390 | @staticmethod |
| 1391 | def hmac(request, secret, algorithm=hashlib.sha256, digest='hex'): |
| 1392 | h = hmac.new(secret, request, algorithm) |
| 1393 | binary = h.digest() |
| 1394 | if digest == 'hex': |
| 1395 | return Exchange.binary_to_base16(binary) |
| 1396 | elif digest == 'base64': |
| 1397 | return Exchange.binary_to_base64(binary) |
| 1398 | return binary |
| 1399 | |
| 1400 | @staticmethod |
| 1401 | def string_to_binary(buff: str) -> bytes: |
Tested by
no test coverage detected