Introduction
PkGen is a pk generator implemented using Python, who’s core algorithm derives from Mongo’s generation of ObjectId.
Basic Concept of ObjectId
A BSON ObjectId is a 12-byte value consisting of a 4-byte timestamp (seconds since epoch), a 3-byte machine id, a 2-byte process id(PID) and a 3-byte counter. Note tha the timestamp and counter fields must be stored big endian unlike the rest of BSON.
Install
2 ways to install PkGen:
clone the repo to your machine, run setup.py
$ cd ~ && git@github.com:streethacker/pkgen.git
$ python setup.py install
using pip
$ pip install -e git+https://github.com/streethacker/pkgen@0.1#egg=pkgen
Start
>>> from pkgen import PkGen
>>> pkg = PkGen()
>>> pk = pkg.pkgen()
>>> pk.pk
'5735ae95c14e2435aa000000'
>>>
Metadata
Release files for pkgen 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pkgen-0.1.tar.gz | 2.5 kB | Without provenance | Details |
Release files / pkgen-0.1.tar.gz
| Download URL | pkgen-0.1.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fea91c28f07be9c9f6cc502161629cbbe22def42c3e80a14b81b331d4f7ac1a2
|
|
BLAKE2b-256 checksum How to use checksums |
a7e5a5fcb2de2f8726b748d3ce8f48ab9954fb458de403788f0e6e2535daa809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pkgen 0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.