RKVST Simplehash algorithm for DLT Anchoring
Reason this release was yanked:
Change in API
Project description
RKVST Simplehash in python
Prescribed python code that defines the hashing algorithm for DLT Anchoring.
Support
This package currently is tested against Python versions 3.7,3.8,3.9 and 3.10.
The current default version is 3.7 - this means that this package will not use any features specific to versions 3.8 and later.
After End of Life of a particular Python version, support is offered on a best effort basis. We may ask you to update your Python version to help solve the problem, if it cannot be reasonably resolved in your current version.
Installation
Use standard python pip utility:
python3 -m pip install rkvst-simplehash
If your version of python3 is too old an error of this type or similar will be emitted:
Example
You can then use the code to recreate the simple hash of a list of SIMPLE_HASH events from RKVST.
"""From a list of events.
"""
from rkvst_simplehash.v1 import hash_events
# if any pending events a SimpleHashPendingEventFound error will be thrown
# if any of the events do not contain the required field then a SimpleHashFieldMissing error will be thrown
simplehash = hash_events(events)
Command Line
This functionality is also available on the cmdline. Execute the simplehash query using curl and pip to the rkvst_simplehashv1 command or the v1.py script.
Installing locally:
Execute this after cloning the repo.
python3 -m pip install bencode.py~=4.0
URL="https://app.rkvst.io/archivist/v2/assets/-/events"
SINCE=timestamp_accepted_since=2022-10-19T00:00:00Z
BEFORE=timestamp_accepted_before=2022-10-26T00:00:00Z
BEARER_TOKEN_FILE=credentials/token
curl -s -X GET \
-H "@$BEARER_TOKEN_FILE" \
"$URL?proof_mechanism=SIMPLE_HASH&${SINCE}&${BEFORE}" | rkvst_simplehash/v1.py
Using a virtual env and published wheel:
This can be executed anywhere using a virtualenv and published wheel.
python3 -m venv simplehash-venv
source simplehash-venv/bin/activate
python3 -m pip install rkvst_simplehash
URL="https://app.rkvst.io/archivist/v2/assets/-/events"
SINCE=timestamp_accepted_since=2022-10-19T00:00:00Z
BEFORE=timestamp_accepted_before=2022-10-26T00:00:00Z
BEARER_TOKEN_FILE=credentials/token
curl -s -X GET \
-H "@$BEARER_TOKEN_FILE" \
"$URL?proof_mechanism=SIMPLE_HASH&${SINCE}&${BEFORE}" | rkvst_simplehashv1
deactivate
rm -rf simplehash-venv
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 rkvst_simplehash-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c19e51ce2928dee471156779fda1467dbb3bd55fe23af170069692f8a2447c3 |
|
MD5 | 3d591f63f76541920e632374b2c7f633 |
|
BLAKE2b-256 | d1973dba4a84f92c2bebc8e41199566b95d157dbe6e99a9cc9115c6f441179d5 |