Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
UUID type is awesome, but, at the moment, the UUID type in the standard library does not support the uuid7 format.
>>> from lastuuid import uuid7
>>> uuid7()
UUID('019316cc-f99a-77b3-89d5-ed8c3cf1f50e')
There is no parameter here, the uuid is generated from the current time.
The implementation of uuid7 algorithm is made in the uuid7 rust crate.
This lib has been created because all the other library that implement uuid7 create there own UUID type, so its not easy to use with pydantic.
from uuid import UUID
from pydantic import BaseModel, Field
from lastuuid import uuid7
class Dummy(BaseModel):
id: UUID = Field(default_factory=uuid7)
On my machine the uuid7 is as fast (or slow) as the native uuid4.
$ python -m timeit "from lastuuid import uuid7; uuid7()"
200000 loops, best of 5: 1.8 usec per loop
$ python -m timeit "from uuid import uuid4; uuid4()"
200000 loops, best of 5: 1.82 usec per loop
Autoincrement your uuid in a test suite avoid some brain pain.
>>> from lastuuid.dummies import uuidgen
>>> uuidgen()
UUID('00000000-0000-0000-0000-000000000001')
>>> uuidgen()
UUID('00000000-0000-0000-0000-000000000002')
Or event more readable; UUID predicted, where only the first bytes needs to be read.
>>> from lastuuid.dummies import uuidgen
>>> uuidgen(1)
UUID('00000001-0000-0000-0000-000000000000')
>>> uuidgen(1,2,3,4,5)
UUID('00000001-0002-0003-0004-000000000005')
FAQs
UUID gen for the python standard library.
We found that lastuuid 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.