Skip to content

Python library for generating short alphanumeric strings from integers

License

Notifications You must be signed in to change notification settings

devknown/alpha-id-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlphaID - Convert any integer to a short alphanumeric version

Release Tests Build License Python version

alpha-id-py

alpha-id-py is a Python library that allows you to generate short alphanumeric strings from integers. It can be useful for creating compact, unique, and obfuscated identifiers.

AlphaID Library Versions

These versions should all function harmoniously, allowing for encoding in one language and decoding in another.

Installation

You can install alpha-id-py using pip:

pip install alpha-id-py

Getting Started

Simple usage looks like this:

from alpha_id.alpha_id import AlphaID

alpha_id = AlphaID()

encoded_string = alpha_id.convert(258456357951)
print(encoded_string)
# Output: '4y7exoH'

original_number = alpha_id.recover('4y7exoH')
print(original_number)
# Output: 258456357951

Configuring a Global Key

You can set a global key that will be used for encoding and decoding if no specific key is provided. This can be done using the config method:

from alpha_id.alpha_id import AlphaID

alpha_id = AlphaID()
alpha_id.config('my_key')

encoded_string = alpha_id.convert(258456357951)
print(encoded_string)
# Output: '4ymMZq9'

original_number = alpha_id.recover('4ymMZq9')
print(original_number)
# Output: 258456357951

License

alpha-id-py is open-source software licensed under the MIT license.

About

Python library for generating short alphanumeric strings from integers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages