
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
The VUID is a Python package designed to generate vahid unique identifiers (VUIDs) based on a custom epoch time and a base-62 encoding scheme. The package provides a simple and efficient way to create unique IDs that can be used in various applications, such as database keys, distributed systems, or any scenario where uniqueness is critical.
START_EPOC_TIME
) to ensure uniqueness and avoid
collisions with other timestamp-based ID systems.To install the package, use pip:
pip install vuid
To generate a unique VUID, simply create an instance of the VUID
class with a timestamp:
from datetime import datetime
from vuid import VUID
# Generate a VUID using the current time
timestamp = datetime.now().timestamp()
vuid = VUID(timestamp)
print(vuid) # Example output: "1A2b3C4d5"
You can extract the creation time of a VUID using the created_time
property:
creation_time = vuid.created_time
print(creation_time) # Example output: "2025-01-04 12:04:08"
If you already have a VUID code, you can create a VUID
object from it:
existing_code = "CS21A2b3C4d5"
vuid = VUID.from_code(existing_code)
print(vuid.created_time) # Output: "2025-07-22 05:24:09"
print(vuid.extra) # Output: 1738
print(vuid.prefix) # Output: "C"
The VUID
class supports comparison operations, allowing you to compare two VUIDs:
vuid1 = VUID(datetime.now().timestamp())
vuid2 = VUID(datetime.now().timestamp())
print(vuid1 == vuid2) # False
print(vuid1 < vuid2) # True or False, depending on the timestamps
VUID(timestamp: int, *, prefix: str = "", extra: int = None)
timestamp
: A timestamp (in seconds) used to generate the VUID.prefix
: A string used to add as prefix in the VUID.extra
: An integer to save extra info in the VUID.VUID
object.VUID.from_code(code: str, *, extra_index: int | None = None)
code
: An existing VUID code.extra_index
: if you have put extra you must the start index of the extra.VUID
object.code
: Returns the code as a string.extra
: Returns the extra as an integer.created_time
: Returns the creation time of the VUID as a datetime
object.__str__()
: Returns the VUID as a string.__repr__()
: Returns a formal representation of the VUID.__eq__(other)
: Compares two VUIDs for equality.__hash__()
: Returns the hash of the VUID.__lt__(other)
, __le__(other)
, __gt__(other)
, __ge__(other)
, __ne__(other)
: Comparison methods for VUIDs.Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the BEER-WARE License. See the LICENSE file for details.
FAQs
Vahid Unique ID Generator
We found that vuid 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.