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:

  • .to_MD5(string)
  • .to_SHA1(string)
  • .to_SHA256(string)
  • .to_SHA512(string)
  • .to_B64(string)
  • .to_B32(string)
  • .to_B85(string)
  • .to_Atbash(string)
  • .to_XOR(string, key)
  • .to_Hex(string)

Decoding:

  • .from_B64(string)
  • .from_B32(string)
  • .from_B85(string)
  • .from_XOR(string, key)
  • .from_Atbash(string)
  • .from_Hex(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.2.tar.gz (3.5 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.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lb_hash_dec-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 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.2.tar.gz
Algorithm Hash digest
SHA256 e31846d2587e703952baded0e451a8fccf9dd66c033609300e3082fc96aaa396
MD5 7e57c2da5d94e4c6733580ee5ea0fedb
BLAKE2b-256 7389c2a6589e0c936e28a4cc16f8b2fa81f17d6622a32928186a874504bb5afa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lb_hash_dec-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31f80f3fab10e7be4b0597647cb3badb9f757860333024bb5e1d2887216642d5
MD5 bf3e3d59dfb70203a0a6a7b2d2d2f349
BLAKE2b-256 eb69eb8d4ccaaf23cc77dfe90a4858573d53f28b2e1a8d30503c8a378e4c3f0a

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