fn encode(
	_p_hash: &Vec<u8>,
	_amount: u128,
	_token: &Vec<u8>,
	_to: &Vec<u8>,
	_n_hash: &Vec<u8>,
) -> Vec<u8> {

	let mut result = vec![0; N_HASH_OFFSET + N_HASH_LENGTH];
	
	let amount_bytes = _amount.to_be_bytes();

	for (i, val) in (&_p_hash[0..]).iter().enumerate() {
        result[i + (P_HASH_LENGTH - _p_hash.len()) + P_HASH_OFFSET] = *val;
	}
	for (i, val) in (&amount_bytes[0..]).iter().enumerate() {
        result[i + (AMOUNT_LENGTH - amount_bytes.len()) + AMOUNT_OFFSET] = *val;
	}
	for (i, val) in (&_token[0..]).iter().enumerate() {
        result[i + (TOKEN_LENGTH - _token.len()) + TOKEN_OFFSET] = *val;
	}
	for (i, val) in (&_to[0..]).iter().enumerate() {
        result[i + (TO_LENGTH - _to.len()) + TO_OFFSET] = *val;
	}
	for (i, val) in (&_n_hash[0..]).iter().enumerate() {
        result[i + (N_HASH_LENGTH - _n_hash.len()) + N_HASH_OFFSET] = *val;
    }

	result
}
// ABI-encode the values for creating the signature hash.
ABI-encode the values for creating the signature hash.
ABI - encode the values for creating the signature hash .
fn encode(
	_p_hash: &Vec<u8>,
	_amount: u128,
	_token: &Vec<u8>,
	_to: &Vec<u8>,
	_n_hash: &Vec<u8>,
) -> Vec<u8> {
	let mut result = vec![0; N_HASH_OFFSET + N_HASH_LENGTH];
	let amount_bytes = _amount.to_be_bytes();
	for (i, val) in (&_p_hash[0..]).iter().enumerate() {
        result[i + (P_HASH_LENGTH - _p_hash.len()) + P_HASH_OFFSET] = *val;
	}
	for (i, val) in (&amount_bytes[0..]).iter().enumerate() {
        result[i + (AMOUNT_LENGTH - amount_bytes.len()) + AMOUNT_OFFSET] = *val;
	}
	for (i, val) in (&_token[0..]).iter().enumerate() {
        result[i + (TOKEN_LENGTH - _token.len()) + TOKEN_OFFSET] = *val;
	}
	for (i, val) in (&_to[0..]).iter().enumerate() {
        result[i + (TO_LENGTH - _to.len()) + TO_OFFSET] = *val;
	}
	for (i, val) in (&_n_hash[0..]).iter().enumerate() {
        result[i + (N_HASH_LENGTH - _n_hash.len()) + N_HASH_OFFSET] = *val;
    }
	result
}
fn encode ( _p_hash : & Vec < u8 > , _amount : u128 , _token : & Vec < u8 > , _to : & Vec < u8 > , _n_hash : & Vec < u8 > , ) -> Vec < u8 > { let mut result = vec ! [ 0 N_HASH_OFFSET N_HASH_LENGTH ] ; let amount_bytes = _amount . to_be_bytes ( ) ; for ( i , val ) in ( & _p_hash [ 0 .. ] ) . iter ( ) . enumerate ( ) { result [ i + ( P_HASH_LENGTH - _p_hash . len ( ) ) + P_HASH_OFFSET ] = * val ; } for ( i , val ) in ( & amount_bytes [ 0 .. ] ) . iter ( ) . enumerate ( ) { result [ i + ( AMOUNT_LENGTH - amount_bytes . len ( ) ) + AMOUNT_OFFSET ] = * val ; } for ( i , val ) in ( & _token [ 0 .. ] ) . iter ( ) . enumerate ( ) { result [ i + ( TOKEN_LENGTH - _token . len ( ) ) + TOKEN_OFFSET ] = * val ; } for ( i , val ) in ( & _to [ 0 .. ] ) . iter ( ) . enumerate ( ) { result [ i + ( TO_LENGTH - _to . len ( ) ) + TO_OFFSET ] = * val ; } for ( i , val ) in ( & _n_hash [ 0 .. ] ) . iter ( ) . enumerate ( ) { result [ i + ( N_HASH_LENGTH - _n_hash . len ( ) ) + N_HASH_OFFSET ] = * val ; } result }
ABI-encode the values for creating the signature hash.
ABI - encode the values for creating the signature hash .
_p_hash
&Vec<u8>
_amount
u128
_token
&Vec<u8>
_to
&Vec<u8>
_n_hash
&Vec<u8>
_p_hash
&Vec<u8>
_amount
u128
_token
&Vec<u8>
_to
&Vec<u8>
_n_hash
&Vec<u8>