File wsh_shell_misc.h
FileList > src > wsh_shell_misc.h
Go to the source code of this file
Miscellaneous helper utilities for the shell. More...
#include "wsh_shell_cfg.h"#include "wsh_shell_types.h"
Public Functions
| Type | Name |
|---|---|
| void | WshShellMisc_AsciiPrint (const WshShell_U8_t * pBuff, WshShell_Size_t len) Print a ASCII dump of a buffer. |
| WshShell_U32_t | WshShellMisc_CalcJenkinsHash (const WshShell_U8_t * pcBuff, WshShell_Size_t len) Calculate Jenkins one-at-a-time hash. |
| void | WshShellMisc_HexDump (const WshShell_U8_t * pBuff, WshShell_Size_t len, WshShell_Size_t offset) Print a hex + ASCII dump of a buffer (hexdump -C style). |
Detailed Description
This module provides various helper functions that do not belong to specific subsystems, but are commonly used across the shell. Currently includes hashing utilities and may be extended in the future.
Author:
Whoosh Embedded Team
Copyright:
Copyright (c) 2025
Public Functions Documentation
function WshShellMisc_AsciiPrint
Print a ASCII dump of a buffer.
Parameters:
pBuffPointer to the data buffer.lenNumber of bytes to dump.
function WshShellMisc_CalcJenkinsHash
Calculate Jenkins one-at-a-time hash.
This function computes the 32-bit Jenkins one-at-a-time hash for the given buffer. It is a simple and fast non-cryptographic (!) hash function, commonly used for hash tables and quick data checksums.
Parameters:
pcBuffPointer to the input buffer.lenNumber of bytes in the input buffer.
Returns:
32-bit hash value computed over the input buffer.
Note:
This hash is not suitable for cryptographic purposes !!! It is designed for speed and good distribution in hash tables.
Jenkins hash function https://en.wikipedia.org/wiki/Jenkins_hash_function
function WshShellMisc_HexDump
Print a hex + ASCII dump of a buffer (hexdump -C style).
Each row contains the byte offset, up to 16 bytes in hex (split into two groups of 8), and their printable ASCII representation. Non-printable bytes are shown as '.'.
Example output:
Parameters:
pBuffPointer to the data buffer. May be NULL only when len == 0.lenNumber of bytes to dump.offsetBase value printed in the offset column (use 0 for relative offsets).
The documentation for this class was generated from the following file src/wsh_shell_misc.h