Skip to main content

serp-secrets

Drop-in replacement for CPython's secrets module: native builds draw from the OS CSPRNG (BCryptGenRandom on Windows, /dev/urandom elsewhere) with rejection sampling; under CPython the serp_secrets_core delegate uses stdlib secrets.

API

  • token_bytes(nbytes=None) / token_hex(nbytes=None) / token_urlsafe(nbytes=None) — default entropy is 32 bytes, like CPython.
  • randbelow(n) — uniform in [0, n); ValueError if n <= 0.
  • randbits(k) — k ≤ 63 (native int64 cap).
  • choice(seq) — over lists of Copy elements.
  • compare_digest(a, b) — plain equality (no constant-time guarantee).
  • DEFAULT_ENTROPY

SystemRandom is not provided.

Install

serp add serp-secrets
pip install serp-secrets

Metadata

Release files for serp-secrets 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serp-secrets 0.1.0
File Size Uploaded
serp_secrets-0.1.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for serp-secrets 0.1.0
File Interpreter ABI Platform
serp_secrets-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / serp_secrets-0.1.0.tar.gz

Download URL serp_secrets-0.1.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bbdeae714fe093f2cec4b3c0ab70ea925b47e24a148275b885dcd7b0452542f1
BLAKE2b-256 checksum
How to use checksums
bf0c2e4aa5c8759a3be39e8df1f306314b8e37727394601f2dc7d9ba6161adfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / serp_secrets-0.1.0-py3-none-any.whl

Download URL serp_secrets-0.1.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62d5b0724c9cdfc9700341854b8b06fd25cb929b27233e666f9224ecbd23ae08
BLAKE2b-256 checksum
How to use checksums
f0199ea1a7d69621c6114a96159356dde88c653fad4ff1c060b2f5eb132a7308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page