nistbeacon/nistbeaconcrypto.py
def get_hash(
            cls,
            version: str,
            frequency: int,
            timestamp: int,
            seed_value: str,
            prev_output: str,
            status_code: str,
    ) -> SHA512Hash:
        """
        Given required properties from a NistBeaconValue,
        compute the SHA512Hash object.

        :param version: NistBeaconValue.version
        :param frequency: NistBeaconValue.frequency
        :param timestamp: NistBeaconValue.timestamp
        :param seed_value: NistBeaconValue.seed_value
        :param prev_output: NistBeaconValue.previous_output_value
        :param status_code: NistBeaconValue.status_code

        :return: SHA512 Hash for NistBeaconValue signature verification
        """
        return SHA512.new(
            version.encode() +
            struct.pack(
                '>1I1Q64s64s1I',
                frequency,
                timestamp,
                binascii.a2b_hex(seed_value),
                binascii.a2b_hex(prev_output),
                int(status_code),
            )
        )
def get_hash(
            cls,
            version: str,
            frequency: int,
            timestamp: int,
            seed_value: str,
            prev_output: str,
            status_code: str,
    ) -> SHA512Hash:
        """
        Given required properties from a NistBeaconValue,
        compute the SHA512Hash object.

        :param version: NistBeaconValue.version
        :param frequency: NistBeaconValue.frequency
        :param timestamp: NistBeaconValue.timestamp
        :param seed_value: NistBeaconValue.seed_value
        :param prev_output: NistBeaconValue.previous_output_value
        :param status_code: NistBeaconValue.status_code

        :return: SHA512 Hash for NistBeaconValue signature verification
        """
        return SHA512.new(
            version.encode() +
            struct.pack(
                '>1I1Q64s64s1I',
                frequency,
                timestamp,
                binascii.a2b_hex(seed_value),
                binascii.a2b_hex(prev_output),
                int(status_code),
            )
        )
Given required properties from a NistBeaconValue,
        compute the SHA512Hash object.

        :param version: NistBeaconValue.version
        :param frequency: NistBeaconValue.frequency
        :param timestamp: NistBeaconValue.timestamp
        :param seed_value: NistBeaconValue.seed_value
        :param prev_output: NistBeaconValue.previous_output_value
        :param status_code: NistBeaconValue.status_code

        :return: SHA512 Hash for NistBeaconValue signature verification