CLI to convert BinData Subtype 3 to JUUID and vice-versa
Project description
Mongo Java UUID Converter
Tool to convert Mongo BinData format to Java UUIDs and vice-versa. It behaves like the Java Mongo Driver which transmits the bytes of the most and least significant bits in little endian format.
I used this snippet from the Mongo C# Driver as reference. I added some comments to explain the bitwise operations if you want to take a look into the source code.
Prerequisites
Python 3.8 installed.
Installation
For End-User
Use Pipx to download and install the application in a virtual environment or do it yourself with Pip and virtualenv:
# use either pipx
pipx install --pip-args=--pre mongojuuid==0.1.0
# or alternatively pip
python3 -m pip install --pre mongojuuid==0.1.0
Usage
CLI
The python installation ships with an executable named mongojuuid
.
Alternatively use python3 -m mongojuuid
Convert to Java UUID
>mongojuuid to-uuid 'BinData(3, gJZnXl0vT+OXdGUUfuRraQ==)'
e34f2f5d-5e67-9680-696b-e47e14657497
Convert to BinData
>mongojuuid to-bindata e34f2f5d-5e67-9680-696b-e47e14657497
BinData(3, gJZnXl0vT+OXdGUUfuRraQ==)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mongojuuid-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92fb9f1d0f39a6a7ee236e6f124607c31ab51900683ca5e2c10ab795751b3067 |
|
MD5 | 6c365ff63fad8c566b3d57f37749a715 |
|
BLAKE2b-256 | 9dfcc5d1e807d9749fdf478e3e38d02a26036247424cbcdd768fbb497ee17a8d |