Skip to main content

lib made for lazy, by lazy

Project description

lb-hash-dec

В© Copyright logic-break 2026

https://github.com/logic-break/logic-break/tree/main/libraries/lb_hash_dec

lib made for lazy, by lazy

installation:

pip install lb-hash-dec

NOTE: in code, you must import lb_hash_dec

What it can do:

Hashing:

  • MD5 Hashing
  • SHA1 Hashing
  • SHA256 Hashing
  • SHA512 Hashing

Encoding:

  • Base64
  • Base32
  • Base85
  • XOR
  • Atbash (A substitution cipher that reverses the alphabet.)
  • HEX

Decoding:

  • XOR
  • Base64
  • Base32
  • Base85
  • Atbash
  • Hex

Features:

  • Fallback: if something goes wrong while decoding, it not gonna crash
  • Nothing more!

How to use:

Import lb_hash_dec and use it hint: use import lb_hash_dec as lb

Usage:

Encoding:

.toMD5(string) .toSHA1(string) .toSHA256(string) .toSHA512(string) .toB64(string) .toB32(string) .toB85(string) .toAtbash(string) .toXOR(string, key) .toHex(string)

Decoding:

.fromB64(string) .fromB32(string) .fromB85(string) .fromXOR(string, key) .fromAtbash(string) .fromHex(string)

Examples:

  1. Standard Hashing and Encoding
import lb_hash_dec as lb
    
data = "logic-break"
    
# Generate a SHA256 hash
print(f"SHA256: {lb.to_SHA256(data)}")
    
# Convert string to Base64 and back
encoded = lb.to_B64(data)
print(f"Base64: {encoded}") # Output: bG9naWMtYnJlYWs=
    
decoded = lb.from_B64(encoded)
print(f"Decoded: {decoded}")
  1. Working with Ciphers (Atbash & XOR
import lb_hash_dec as lb

message = "SecretMessage"

# Apply Atbash cipher (Mirror alphabet)
encrypted_atbash = lb.to_Atbash(message)
print(f"Atbash Encrypted: {encrypted_atbash}") # Output: HvxivgNvhhztv

# Use XOR encryption with a numeric key
key = 42
encrypted_xor = lb.to_XOR(message, key)
print(f"XOR Encrypted: {encrypted_xor}")

# Decrypt XOR back to original
print(f"XOR Decrypted: {lb.from_XOR(encrypted_xor, key)}")
  1. Error Handling
import lb_hash_dec as lb

# Trying to decode invalid data
invalid_data = "This is not hex!"

# The library returns a helpful error string instead of crashing
result = lb.from_Hex(invalid_data)
print(f"Hex Result: {result}") # Output: Error: Invalid Hex data

# Atbash check for non-English characters
print(lb.to_Atbash("Привет")) # Output: Only english letter supported!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lb_hash_dec-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lb_hash_dec-0.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file lb_hash_dec-0.0.1.tar.gz.

File metadata

  • Download URL: lb_hash_dec-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for lb_hash_dec-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c741fe82b20b4098c4bc8a3f2f2695484aaea6d374a91bb7e2bdac3a3f0a9c49
MD5 5e3b869b03c8a8bc2d41c8a7b8b20565
BLAKE2b-256 07457e443f4687dfc88972501b021ba4bd8e1ee31a8266df9435db0789f8be2f

See more details on using hashes here.

File details

Details for the file lb_hash_dec-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lb_hash_dec-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for lb_hash_dec-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77a89e46b3a02694743615b93a8219fb4cc7362aa4130da377d19c78d7be7b70
MD5 c6459f626f40ca8b4f93ebb6ef49a134
BLAKE2b-256 8f3fc4e6d89d42362e86053c19a60af80b740f4f3dfe1683274d6c6780fd6036

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page