fn directory_keys_only(target: &Target, directory: &Path) -> Result<Vec<String>, failure::Error> {
    let mut key_vec: Vec<String> = Vec::new();

    let dir_walker = get_dir_iterator(target, directory)?;

    for entry in dir_walker {
        let entry = entry.unwrap();
        let path = entry.path();
        if path.is_file() {
            let value = std::fs::read(path)?;

            // Need to base64 encode value
            let b64_value = base64::encode(&value);

            let (_, key) = generate_path_and_key(path, directory, Some(b64_value))?;

            validate_key_size(&key)?;

            key_vec.push(key);
        }
    }
    Ok(key_vec)
}
// Returns only the hashed keys for a directory's files.
Returns only the hashed keys for a directory's files.
Returns only the hashed keys for a directory ' s files .
fn directory_keys_only(target: &Target, directory: &Path) -> Result<Vec<String>, failure::Error> {
    let mut key_vec: Vec<String> = Vec::new();
    let dir_walker = get_dir_iterator(target, directory)?;
    for entry in dir_walker {
        let entry = entry.unwrap();
        let path = entry.path();
        if path.is_file() {
            let value = std::fs::read(path)?;
            // Need to base64 encode value
            let b64_value = base64::encode(&value);
            let (_, key) = generate_path_and_key(path, directory, Some(b64_value))?;
            validate_key_size(&key)?;
            key_vec.push(key);
        }
    }
    Ok(key_vec)
}
fn directory_keys_only ( target : & Target , directory : & Path ) -> Result < Vec < String > , failure :: Error > { let mut key_vec : Vec < String > = Vec :: new ( ) ; let dir_walker = get_dir_iterator ( target , directory ) ? ; for entry in dir_walker { let entry = entry . unwrap ( ) ; let path = entry . path ( ) ; if path . is_file ( ) { let value = std :: fs :: read ( path ) ? ; // Need to base64 encode value let b64_value = base64 :: encode ( & value ) ; let ( _ , key ) = generate_path_and_key ( path , directory , Some ( b64_value ) ) ? ; validate_key_size ( & key ) ? ; key_vec . push ( key ) ; } } Ok ( key_vec ) }
Returns only the hashed keys for a directory's files.
Returns only the hashed keys for a directory ' s files .
target
&Target
directory
&Path