Skip to main content

add_to_name_hash

Function add_to_name_hash 

Source
pub fn add_to_name_hash(config_json: &str, name: &str) -> Result<String>
Expand description

Add a name to the NAME_HASH array

§Arguments

  • config_json - Configuration JSON string
  • name - Name value to add

§Returns

Returns modified configuration JSON on success

§Example

use sz_configtool_lib::hashes;

let config = r#"{"G2_CONFIG": {"SYS_OOM": {"NAME_HASH": []}}}"#;
let modified = hashes::add_to_name_hash(config, "JOHN").unwrap();