pub fn add_tryte_checksum(address: TryteAddress) -> Result<String, JsValue> {
    let mut kerl = Kerl::new();
    let hash = kerl
        .digest(
            Trits::try_from_raw(
                &[address.to_inner().as_i8_slice(), &[0, 0, 0]].concat(),
                243,
            )
            .unwrap(),
        )
        .unwrap()
        .iter_trytes()
        .map(char::from)
        .collect::<String>();

    Ok(format!(
        "{}{}",
        address
            .to_inner()
            .encode::<T3B1Buf>()
            .iter_trytes()
            .map(char::from)
            .collect::<String>(),
        &hash[72..81]
    ))
}
/// Add 9 Trytes checksum to an address and return it as String
Add 9 Trytes checksum to an address and return it as String
Add 9 Trytes checksum to an address and return it as String
pub fn add_tryte_checksum(address: TryteAddress) -> Result<String, JsValue> {
    let mut kerl = Kerl::new();
    let hash = kerl
        .digest(
            Trits::try_from_raw(
                &[address.to_inner().as_i8_slice(), &[0, 0, 0]].concat(),
                243,
            )
            .unwrap(),
        )
        .unwrap()
        .iter_trytes()
        .map(char::from)
        .collect::<String>();
    Ok(format!(
        "{}{}",
        address
            .to_inner()
            .encode::<T3B1Buf>()
            .iter_trytes()
            .map(char::from)
            .collect::<String>(),
        &hash[72..81]
    ))
}
pub fn add_tryte_checksum ( address : TryteAddress ) -> Result < String , JsValue > { let mut kerl = Kerl :: new ( ) ; let hash = kerl . digest ( Trits :: try_from_raw ( & [ address . to_inner ( ) . as_i8_slice ( ) , & [ 0 , 0 , 0 ] ] . concat ( ) , 243 , ) . unwrap ( ) , ) . unwrap ( ) . iter_trytes ( ) . map ( char :: from ) . collect :: < String > ( ) ; Ok ( format ! ( " " address to_inner ( ) encode T3B1Buf ( ) iter_trytes ( ) map ( char from ) collect String ( ) hash [ 72 81 ] ) ) }
Add 9 Trytes checksum to an address and return it as String
Add 9 Trytes checksum to an address and return it as String
address
TryteAddress
address
TryteAddress