See API v1 Changelog for details
pip install hashids
python3 convert.py <my-hashid>
Example:
python3 convert.py o1kcol
Table: roles, Identifier: 49
See API v1 Changelog for details
pip install hashids
python3 convert.py <my-hashid>
Example:
python3 convert.py o1kcol
Table: roles, Identifier: 49
import sys | |
from hashids import Hashids | |
salt = "GRdrheher42342@gerergwqefqwwt346SDGDFGG" | |
hash_length = 6 | |
alphabet = "abcdefghijklmnopqrstuvwxyz1234567890" | |
tables = [ | |
"accounts", "actuals", "assignments", "clients", "contracts", | |
"help_documents", "holidays", "holidays_groups", "invitations", | |
"milestones", "notes", "people", "phases", "project_rates", | |
"project_roles", "projects", "rate_cards", "role_charge_out_rate", | |
"roles", "schedules", "tags", "teams", "time_offs", "users" | |
] | |
def decode_hashid(hashid): | |
for table_name in tables: | |
hashids = Hashids(salt=f"{table_name}{salt}", min_length=hash_length, alphabet=alphabet) | |
decoded = hashids.decode(hashid) | |
if decoded: | |
return table_name, decoded[1] | |
return None, None | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print("Usage: python script.py <hashid>") | |
sys.exit(1) | |
hashid_to_decode = sys.argv[1] | |
table_name, decoded_value = decode_hashid(hashid_to_decode) | |
if table_name and decoded_value is not None: | |
print(f"Table: {table_name}, Identifier: {decoded_value}") | |
else: | |
print("No matching table found for the provided hashid.") |