HSL 2.0 framework Description of the framework

Public Member Functions |List of all members
hsl20_4_crypto.hsl20_4_crypto.SHA1Hash Class Reference

Class to generate a SHA-1 hash value More..

## Public Member Functions
def | __init__ (self)
| Constructor
def | update (self, data)
| Updates the SHA1 hash value with the transferred data. More...
def | digest (self)
| Returns the SHA1 code. More...
def | hex_digest (self)
| Returns the SHA1 code as hex string. More...

## Detailed Description

Class to generate a SHA-1 hash value

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_sha1_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 arrives at input 2 (PIN_I_DO_HASH), a hash code is formed for the data block (string) at input 1 (PIN_I_DATA). Then the hash code is output as hexadecimal number on output 1 (PIN_O_HEXCODE)

## Member Function Documentation

## ◆ digest()

def hsl20_4_crypto.hsl20_4_crypto.SHA1Hash.digest | ( |  | self | ) |

Returns the SHA1 code

Returns
  string
  SHA1 code

## ◆ hex_digest()

def hsl20_4_crypto.hsl20_4_crypto.SHA1Hash.hex_digest | ( |  | self | ) |

Returns the SHA1 code as a hex string

Returns
  string
  SHA1 code

## ◆ update()

def hsl20_4_crypto.hsl20_4_crypto.SHA1Hash.update | ( |  | self,
|  |  | data
| ) |  |

Updates the SHA1 hash value with the transferred data

Parameters

  data | string Data block

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

- hsl20_4_crypto.py