/// Creates a target ID for the given data.
///
/// # Errors
/// * InvalidNiDkgTargetIdSizeError: if the target ID size is invalid.
Creates a target ID for the given data.
Creates a target ID for the given data .
pub fn ni_dkg_target_id(data: &[u8]) -> Result<NiDkgTargetId, InvalidNiDkgTargetIdSizeError> {
    if data.len() != NiDkgTargetId::SIZE {
        return Err(InvalidNiDkgTargetIdSizeError);
    }
    let mut result = [0; NiDkgTargetId::SIZE];
    result.copy_from_slice(data);
    Ok(NiDkgTargetId::new(result))
}
pub fn ni_dkg_target_id ( data : & [ u8 ] ) -> Result < NiDkgTargetId , InvalidNiDkgTargetIdSizeError > { if data . len ( ) != NiDkgTargetId :: SIZE { return Err ( InvalidNiDkgTargetIdSizeError ) ; } let mut result = [ 0 ; NiDkgTargetId :: SIZE ] ; result . copy_from_slice ( data ) ; Ok ( NiDkgTargetId :: new ( result ) ) }
Creates a target ID for the given data.
Creates a target ID for the given data .
data
&[u8]
errors
if the target ID size is invalid.
if the target ID size is invalid .