No project description provided
Project description
@COPYRIGHT 2024 By Kyfstore
How To Use
This is the tutorial on how to use BinaryAndSerializableMath package for python. Like in the name, this package is a simple math package but also includes a Binary and Serializable class that allows you to convert integers, and strings to and from binary as well as convert binary to and from a custom serializable alphabet that can only use the package to crack. Note: Serializable class only supports lowercase letters. Any fancy chars, numbers, or punctuation will break it such as 78, {}, [], ., or !. This package goes great along with RedVert which is a package I also made as well! RedVert is used to create files with custom extensions so you can create a very secure file will a lowercase-letter only password such as cookiesaregreat by first converting them binary and them the custom serializable alphabet and them back again. I will teach you the very basics of it.
Python Use
To use this package in python, you first need to know the main functions which are:
- add
- sub
- mul
- div
- power
- Binary.binary
- Binary.debinary
- Serializable.serialize
- Serializable.deserialize
The first 5 are simple ones for addition, subtraction, multiplication, division, and powers. The last 4 are the actual fun, main functions. Binary.binary can convert a int (integer) or str (string) into a binary representation. One use could be:
from binaryandserializeablemath import *
pic = Binary.binary("Python Is Cool")
This short script will return the binary representation of, "Python Is Cool" into a variable called pic (short for Python Is Cool). Also, with this same idea, you can convert from binary. So it would look something like:
from binaryandserializeablemath import *
picBinary = Binary.binary("Python Is Cool")
picDebinary = Binary.debinary(picBinary)
print(picDebinary)
This script will store a variable called picBinary for storing the binary of Python Is Cool and the variable picDebinary will store the variable of converting the binary back into a string and later printing the output which should be:
Python Is Cool
Next, is the Serializable class. First is the Serializable.serialize function. To use it, you need two arguments, the input, either a string or integer, and the type of serialization you want to do, either use, "t" or "n". N for numbers and T for text. An example of both are below:
from binaryandserializeablemath import *
picSer = Serializable.serialize("python is cool", "t")
from binaryandserializeablemath import *
numSer = Serializable.serialize(190, "n")
The last function is Serializable.deserialize which by the name, you should now it will deserialize a previously serialized variable. And once again, it requires two arguments, the input and type of serialization. Below is once again two examples:
from binaryandserializeablemath import *
picSer = Serializable.serialize("python is cool", "t")
picDeSer = Serializable.deserialize(picSer, "t")
print(picDeSer)
from binaryandserializeablemath import *
numSer = Serializable.serialize(190, "n")
numDeSer = Serializable.deserialize(numSer, "n")
print(numDeSer)
That was the current basics of the basm (short for binaryandserializablemath). That's it, Bye!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file binaryandserializablemath-1.0.1.tar.gz.
File metadata
- Download URL: binaryandserializablemath-1.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f786cee51ae8e34fadd7ab2bba90a2b2f37496ec8ab6607b14ef854853bc41d3
|
|
| MD5 |
4f5af7decb554fc0651ae1052be0c609
|
|
| BLAKE2b-256 |
9650d67048edac350aad7a7dd743418b989bd0e931cf26648d756c9cccae4a76
|
File details
Details for the file BinaryAndSerializableMath-1.0.1-py3-none-any.whl.
File metadata
- Download URL: BinaryAndSerializableMath-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9253514c17c447fc742d04c49f5358df81762b77316398a94a1ca59965546ac9
|
|
| MD5 |
d746722ab86e84b28e2fe361f4b10676
|
|
| BLAKE2b-256 |
f6747caaa692c2c87d7784070af1f6bc9f054f3b6089dafa497099cd6022d397
|