import hashlib


def _digest(data):
    """SHA1 hash digest of message data.

    Implements RFC2437, 9.2.1 EMSA-PKCS1-v1_5, Step 1. for "Hash = SHA1"

    Args:
      data: str of bytes to digest
    Returns:
      str: of bytes of digest from "data"
    """
    hasher = hashlib.sha1()
    hasher.update(data)

    return hasher.digest()