MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / _calc_hmac

Function _calc_hmac

web/pgadmin/utils/session.py:48–53  ·  view source on GitHub ↗
(body, secret)

Source from the content-addressed store, hash-verified

46
47
48def _calc_hmac(body, secret):
49 return base64.b64encode(
50 hmac.new(
51 secret.encode(), body.encode(), hashlib.sha256
52 ).digest()
53 ).decode()
54
55
56# File-HMAC: protects on-disk session files against tampering before

Callers 1

signMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected