SUIT Framework

Scripting Using Integrated Templates

Docs - loghash

07/31/2010: SUIT 2.0.1 and Rulebox 1.1.0 released.

Available Since: SUIT (2.0.0)

Hash specific keys for logging.

Syntax dict suit.loghash ( dict entry, list items )
Parameters
entry

The dict.

items

The items to hash in the dict.

Return Value

The dict with the specified items hashed.

Examples
Basic Usage
PHP
<?php
require 'suit.class.php';
$suit = new SUIT();
$entry = array
(
    'config' => array
    (
        'unclosed' => false,
        'insensitive' => true,
        'log' => true,
        'mismatched' => false,
        'escape' => ''
    ),
    'contents' => array()
);
$entry = $suit->loghash($entry, array('config'));
/*
Result: array
(
    'config' => 'e9b7b42182b735ccd2c6fbc67978d0d0',
    'contents' => array()
)
*/
?>
Python
import suit
entry = {
    'config': {
        'unclosed': False,
        'insensitive': True,
        'log': True,
        'mismatched': False,
        'escape': ''
    },
    'contents': []
}
entry = suit.loghash(entry, ['config'])
# Result: {
#     'config': 'e9b7b42182b735ccd2c6fbc67978d0d0',
#     'contents': []
# }
See Also