HSL 2.0 framework
Description of the framework
Public Member Functions |List of all members
hsl20_4_crypto.hsl20_4_crypto.MD5Hash Class Reference

Class for generating an MD5 hash. More..

Public Member Functions

def__init__ (self)
Constructor. More...
defupdate (self, data)
Updates the MD5 hash with the transferred data. More...
defdigest (self)
Returns the MD5 code. More...
defhex_digest (self)
Returns the MD5 code as hex string. More...

Detailed Description

Class for generating an MD5 hash

Part of the packet for encryption

class Crypto_HASH(hsl20_4.BaseModule):
def __init__(self, homeserver_context):
....
def on_input_value(self, index, value):
if index == self.PIN_I_DO_HASH:
hash = self.FRAMEWORK.create_md5_hash()
hash.update(self._get_input_value(self.PIN_I_DATA))
self._set_output_value(self.PIN_O_HEXCODE, hash.hex_digest())

If a telegram is received at input PIN_I_DO_HASH, a hash code is formed for the data block (string) at input PIN_I_DATA. Then the hash code is output as hexadecimal number at output PIN_O_HEXCODE

Constructor & Destructor Documentation

◆ __init__()

def hsl20_4_crypto.hsl20_4_crypto.MD5Hash.__init__ ( self)

Constructor

Warning
This class should not be instantiated directly

Member Function Documentation

◆ digest()

def hsl20_4_crypto.hsl20_4_crypto.MD5Hash.digest ( self)

Returns the MD5 code

Returns
string
MD5 code

◆ hex_digest()

def hsl20_4_crypto.hsl20_4_crypto.MD5Hash.hex_digest ( self)

Returns the MD5 code as hex string

Returns
string
MD5 code

◆ update()

def hsl20_4_crypto.hsl20_4_crypto.MD5Hash.update ( self,
data
)

Updates the MD5 hash with the transferred data

Parameters
datastring
Data block

The documentation for this class was generated from the following file: