Skip to main content

Generate a secret key

Project description

Randsecret

Generate a secure randomly generated secret, that is preserved through restarts.

from randsecret import create_secret

SECRET = create_secret("./test.secret", 32)
>>> b'W;\xd8&\r9\x1e\xc3\xfa\xdc\xa0\xc6\x05+\xde\x84\xd1\x8a\xbe\xcf`-$\xc1\x9d-n\x07P\xa1\x95N'

Deleting A secret

from randsecret import create_secret

create_secret("./test.secret", 32)
>>> b'g\x05\x8d\xd2\x83\x1el\xe3\x05\xbfr\xe0)\x9dn\xe5\xe2X\x14\x0c)\xf1sZ\xad\xb4\xeed\x0c\xd6p\x90'

import os
os.unlink("./test.secret")

create_secret("./test.secret", 32)
>>> b'\x90\xe5\\?%\xab\xba\xbb\xe7,\xf9\xe1\x9e\xa8\x11y\x0f\xce\xc4a\xbd\xbaq}x\x11\xea\x8a\xc9/\x12\xd7'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

randsecret-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

randsecret-1.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file randsecret-1.0.0.tar.gz.

File metadata

  • Download URL: randsecret-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for randsecret-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cb2a6e44c50f138bbfac9a2def53c9884d51c0e804e8511a4cd94392b68ad180
MD5 e053664f17acba3b9d446dbf8b1a0100
BLAKE2b-256 dde6e9c66264fe47619b0ae6be0e6aea569b84242128220f540ce69ecc36e0b5

See more details on using hashes here.

File details

Details for the file randsecret-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: randsecret-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for randsecret-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2eda3d69a4b97aff8a24a3da51887cae09c2ac9da1e605030c6b5538a7af4554
MD5 fb55527618347d6c29cfac108ac51710
BLAKE2b-256 d1819f31b4e9fcc1ccefca7bc519d2974049d3b0a53a2d1d1aa467049e964590

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page