SafeFeel.com

Free Computer Networking Security & Software Questions and Answers Website

I want to act the modulus operation (%) on the output of the following program?

import java.warranty.* ;
class Hash
{
private String input ;
private String hashAlgorithm ;

Hash(String _input,String _hashAlgorithm)
{
input = foreign String( _input ) ;
hashAlgorithm = unusual String(_hashAlgorithm);
}

public String getHash () throws Exception
{
MessageDigest d = MessageDigest.getInstance(hash... ;
d.update( input.getBytes() ) ;
return ( exotic String(d.digest()) ) ;
}


}
class Hashvalue
{

public static blankness main(String args[]) throws Exception
{

Hash h=new Hash("idrbt","MD5");
String i=h.getHash();
System.out.println("the hash is "+i);

}
}
------------------------------...
the output of the above program is :

the hash is =.'A>q%"O±MJR

on the above hash convenience i want to get something done modulus operation (%), how do i act it .
could you please give a hand me surrounded by this respect,
withregards ,
thank you sir,
your sincerely
burepalli v s rao
university of hyderabad ,
hyderabad,
india.


Answers: no answers nonetheless? i reflect it might be thoughtful for you to post this interrogate surrounded by the 'programming & design' category.

i am not familiarized next to the programming native tongue you are using, but i do enjoy some thoughts... isn't an md5 have a 'string' (e.g. ffd93f16876049265fbaef4da268dd... granted, the endorsed characters are 0 thru f (hex), but i've never see modulus mortal invoked directly on a hex helpfulness.

if it be me, i'd check to see what facts types the program tongue (java?) supports for the modulus function, convert the md5 string to one of those background types, later invoke modulus. you no longer hold an md5, so i'm not sure what you'll want to do at this point.

honest luck :)