Skip to main content

Hashing

Latest Version LGPLv3 License Build Status Codecov

A python module to use hash tables and hash functions in your project.

Usage

data

data = [{"Acre (AC)": ["AC", 1]},
        {"Amazonas (AM)": ["AM", 4]},
        {"Bahia (BA)": ["BA", 5]},
        {"Ceará (CE)": ["CE", 6]},
        {"Espírito Santo (ES)": ["ES", 8]},
        {"Goiás (GO)": ["GO", 9]},
        {"Maranhão (MA)": ["MA", 10]},
        {"Mato Grosso (MT)": ["MT", 11]},
        {"Piauí (PI)": ["PI", 18]},
        {"Rio de Janeiro (RJ)": ["RJ", 19]},
        {"Rio Grande do Sul (RS)": ["RS", 21]},
        {"Santa Catarina (SC)": ["SC", 24]},
        {"São Paulo (SP)": ["SP", 25]},
        {"Sergipe (SE)": ["SE", 26]},
        {"Tocantins (TO)": ["TO", 27]}]

Traditional implementation

for x in data:
    if list(x.keys())[0] == "São Paulo (SP)":
        # After 13 times 
        print(x[1]) 
        # result: 25

Hashing implementation

import hashfunctions.hashtables as ht
table = ht.hash_table(data, 0)
# Just 1 time
sp = print(ht.get_data(table, 0, 'São Paulo (SP)')[0][1])
# result: 25

Handling

insert_tocatins  = ht.insert_data(table, 0, [{"Tocantins (TO)": ["TO", 27]}])
remove_sergipe = ht.del_data(table, 0, "Sergipe (SE)")
update_rio = ht.update_data(
	table, 0, "Rio de Jaineiro (RJ)", {"Rio de Janeiro": ["RJ", 100]
}

Metadata

Release files for HashFunction 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for HashFunction 0.0.2
File Size Uploaded
HashFunction-0.0.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for HashFunction 0.0.2
File Interpreter ABI Platform
HashFunction-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / HashFunction-0.0.2.tar.gz

Download URL HashFunction-0.0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d9d3447e56a9c1c2aaf7d86c6ab0847ea98550732b35740fc87f0962c6711650
BLAKE2b-256 checksum
How to use checksums
73fe2b40e9fa71fc61cdb352ba2794ba4a53aa6a48543f63304d549c6956400a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release files / HashFunction-0.0.2-py3-none-any.whl

Download URL HashFunction-0.0.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f49eea9796c751cfdab6791a9fba175259c19bd021fe91b903b4e7228c6b69a3
BLAKE2b-256 checksum
How to use checksums
73cf7bd72138ae2d6aa5e7aa87a2f441007cd844af3a36d66457f2ec2255328e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page