def crypto_hash(message): """ Hashes and returns the message ``message``. :param message: bytes :rtype: bytes """ digest = ffi.new("unsigned char[]", crypto_hash_BYTES) rc = lib.crypto_hash(digest, message, len(message)) ensure(rc == 0, 'Unexpected library error', raising=exc.RuntimeError) return ffi.buffer(digest, crypto_hash_BYTES)[:]