hashit

Hashit an hashing application

This project is maintained by cjavad

With the new release, i have added support for loading thirdparty hashfunction to hashit via load() and GLOBAL basicly it adds a new entry to GLOBAL.EXTRA with its’ name and class. The way these plugins work are quite simple, all it needs is a hashlib compatible api as such:

plugin.py

class thirdpartyhash:
    """Api for another hashfunction"""
    name = "hashname" # define now or in self.name
    
    def __init__(self, data=b''):
        # self.name = "hashname"
        self.data = data

    def update(self, data):
        self.data += data

    def digest(self):
        # use whatever function you need
        return hashname(self.data).raw
    
    def hexdigest(self):
        # convert output to hex
        return convert_to_hex(self.digest())
    
    # the copy function is optional, not needed
    # but is still a part of the api
    def copy(self):
        return thirdpartyhash(self.data)


hashit (.py) a new executable

import sys
from hashit.__main__ import main, load
from plugin import thirdpartyhash as tph

load(tph)
main(sys.argv[1:])

or

pythonprogram.py your own program using hashits’ hashing functions

from hashit import new, load, hashFile
from plugin import thirdpartyhash as tph

load(tph)
hasher = new("hashname")
print(hashFile("somefile.ext", hasher, True))

See extra for more

back