bda.basen
Module to represent integers as any other based representation string.
There exist direct converter functions.
>>> from bda.basen import str2int
>>> from bda.basen import int2str
>>> ref = 'abcde'
>>> int2str(12345, ref)
'deddea'
>>> str2int('abcde', ref)
194
Or a direct representation call for a 62 ascii based base.
>>> from bda.basen import base62
>>> term = base62(100)
>>> str(term)
'1C'
>>> term = base62('1D')
>>> int(term)
101
This works also with uuids, which is with ~22 chars less than the default hex with 32 chars:
>>> term = base62(uuid.uuid4())
basej uses 91 chars ascii as base (no backslash, no single/double quotes, no control chars). With this a chance to get 20 chars for a uuid is high:
>>> term = basej(uuid.uuid4())
Source Code and Contributions
If you want to help with the development (improvement, update, bug-fixing, …) of bda.basen this is a great idea! Submit issues or pull requests!
The code is located at github.
Maintainer is Jens Klein, Robert Niederreiter and the BlueDynamics Alliance developer team. We appreciate any contribution and if a release is needed to be done on pypi, please just contact one of us dev@bluedynamics dot com
Code is licensed under GPL v2. History =======
1.2 (2019-09-09)
Support for Python 3 [jensens]
1.1 (2016-05-25)
Support for python uuid module [jensens]
more generic basex base class and special basej class. [jensens]
1.0
initial implementation [rnixx, jensens]
Metadata
Release files for bda.basen 1.2
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 | Actions |
|---|---|---|---|---|
| bda.basen-1.2.tar.gz | 3.4 kB | Without provenance | Details for bda.basen-1.2.tar.gz |
Release files / bda.basen-1.2.tar.gz
| Download URL | bda.basen-1.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1ce771afa58be9515dcc4b73cb5e8656f357eb1e24623340bb70836a8e24c1d
|
|
BLAKE2b-256 checksum How to use checksums |
687965945fd4778c3a1fe9e5ac6636683846ca002231a521e1773bf60a9d79dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3
|
Security for bda.basen 1.2
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.