pyhsm.util

Package pyhsm :: Module util |
[frames] | no frames]

# Module util

collection of utility functions

Functions
hexdump(src, length=8) Produce a string hexdump of src, for debug output. |
group(data, num) Split data into chunks of num chars each |
key_handle_to_int(this) Turn "123" into 123 and "KSM1" into 827151179 (0x314d534b, 'K' = 0x4b, S = '0x53', M = 0x4d). |

Function Details

### key_handle_to_int(this) |
Turn "123" into 123 and "KSM1" into 827151179 (0x314d534b, 'K' = 0x4b, S = '0x53', M = 0x4d). YHSM is little endian, so this makes the bytes KSM1 appear in the most human readable form in packet traces.