• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This file is dual licensed under the terms of the Apache License, Version
2# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3# for complete details.
4
5from __future__ import absolute_import, division, print_function
6
7import hmac
8
9
10def bytes_eq(a, b):
11    if not isinstance(a, bytes) or not isinstance(b, bytes):
12        raise TypeError("a and b must be bytes.")
13
14    return hmac.compare_digest(a, b)
15