Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This package provides rindex()
function that returns last index of value in sequence.
pip install rindex
from rindex import rindex
numbers = [5, 1, 3, 8, 10, 5, 8, 1, 8, 3]
print(rindex(numbers, 1)) # 7
print(rindex(numbers, 8, 4, 8)) # 6
Support all features of built-in .index()
Speed
Portability (support for different platforms)
Currently, the library includes three rindex()
implementations:
Cython
Pure Python (when the Cython one is not available; slower)
Pure Python for PyPy
Supports any sequences
Supports start
and stop
(both may be negative or out of bounds)
Doesn't copy the sequence
You can set environment variable ENABLE_RINDEX_EXTENSIONS
to 0
or 1
to forcefully disable/enable Cython extensions.
This can be useful if you face compilation problems and want to use pure Python version.
tests/benchmark.py
can generate interactive plots with comparisons of different implementations.
FAQs
rindex() function for sequences
We found that rindex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.