Skip to content

Kefkius/hexs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexs

This is a very small package which contains functions that format hex strings. The purpose of this formatting is to make a given hex string of even length, remove a "0x" prefix if present, and remove a "L" suffix if present.

It also includes a convenience function, hexs(), which calls the built-in hex() function and formats the result.

Usage

>>> from hexs import is_hex, hexs, format_hex
>>> hexs(5)
'05'
>>> format_hex('0x5')
'05'
>>> is_hex('g')
False
>>> is_hex(29)
False
>>> is_hex('f')
True

License

MIT License.

About

Python hex string formatting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages