Hashes and returns the message ``message``.

    :param message: bytes
    :rtype: bytes
765751
def crypto_hash_sha512(message):
    
    digest = ffi.new("unsigned char[]", crypto_hash_sha512_BYTES)
    rc = lib.crypto_hash_sha512(digest, message, len(message))
    ensure(rc == 0,
           'Unexpected library error',
           raising=exc.RuntimeError)
    return ffi.buffer(digest, crypto_hash_sha512_BYTES)[:]
805512
def serialize_email_messages(messages: List[EmailMessage]):
    
    return [
        base64.b64encode(zlib.compress(pickle.dumps(m, protocol=4))).decode()
        for m in messages
    ]
172854
def hashlib_sha256(message):
        
        hashlib_sha256 = hashlib.sha256()
        hashlib_sha256.update(message.encode('utf-8'))
        hashed_str = hashlib_sha256.hexdigest()
        return hashed_str
825306
def get_message_data(msg, key):
    ''''''
    data = msg
    paths = key.split('.')
    for i in paths:
        data = getattr(data, i)
    return data
866351
def wrap(self, message):
        
        cipher_text = _Ntlm2Session.encrypt(self, message)
        signature = _Ntlm2Session.sign(self, message)
        return cipher_text, signature
75414
def process_message(message):
    
    message["type"] = message.pop("MsgType").lower()
    if message["type"] == 'event':
        message["type"] = str(message.pop("Event")).lower() + '_event'
        message_type = EventMetaClass.TYPES.get(message["type"], UnknownEvent)
    else:
        message_type = MessageMetaClass.TYPES.get(
            message["type"], UnknownMessage
        )
    return message_type(message)
819927
def hashZ(*args):
    
    TAG = "TAG_RELIC_HASH_Z"
    MESSAGE = "MESSAGE_HASH_Z"

    # Combine the arguments into a canonical string representation.
    text = TAG.join([str(val) for val in args ] )

    # Hash the string using HMAC
    # b: byte string 
    b = hmac(text, MESSAGE)
    return BigInt(longFromString(b))
878197
def parse_message(message, nodata=False):
    
    header = read_machine_header(message)
    h_len = __get_machine_header_length(header)
    meta_raw = message[h_len:h_len + header['meta_len']]
    meta = __parse_meta(meta_raw, header)
    data_start = h_len + header['meta_len']
    data = b''
    if not nodata:
        data = __decompress(
            meta,
            message[data_start:data_start + header['data_len']]
        )
    return header, meta, data
635901
def sha256(message, encoder=nacl.encoding.HexEncoder):
    
    return encoder.encode(nacl.bindings.crypto_hash_sha256(message))
997670
def RegisterMessage(self, message):
    

    desc = message.DESCRIPTOR
    self._classes[desc.full_name] = message
    self.pool.AddDescriptor(desc)
    return message
1245703
def hash(ctx, message_id, message):
    
    conf = Config(message_id=message_id)

    mail = Mail(message, conf)

    logger.info(mail.header_text)
    logger.info('-' * 70)
    logger.info('Hash: {}'.format(mail.hash_key))
1157484
def get_message(self):
        
        if not self._message:
            return None
        self._populate_message_attributes(self._message)
        return self._message
898796
def decode_message(self, message, is_key=False):
        

        if message is None:
            return None

        if len(message) <= 5:
            raise SerializerError("message is too small to decode")

        with ContextStringIO(message) as payload:
            magic, schema_id = struct.unpack('>bI', payload.read(5))
            if magic != MAGIC_BYTE:
                raise SerializerError("message does not start with magic byte")
            decoder_func = self._get_decoder_func(schema_id, payload, is_key)
            return decoder_func(payload)
548995
function digest(message) {
    return message.id || sha1(serializeNodes(message.nodes).join('') + ("[" + message.meaning + "]"));
}
788739
def unpack_messages(msgs):
        import msgpack
        

        for key, msg in msgs:
            record = msgpack.unpackb(msg)
            record['_key'] = key
            yield record
1371026
def bitcoin_sig_hash(message):
    
    padded = b'\x18Bitcoin Signed Message:\n' +\
        int_to_var_bytes(len(message)) +\
        message
    return double_sha256(padded)
250546
def unpack_message(buffer):
    
    hdr_size = Header().get_size()
    hdr_buff, msg_buff = buffer[:hdr_size], buffer[hdr_size:]
    header = Header()
    header.unpack(hdr_buff)
    message = new_message_from_header(header)
    message.unpack(msg_buff)
    return message