SHA1 key has 40 hexadecimal
public boolean isSHA1(String s) { return s.matches("[a-fA-F0-9]{40}"); }
MD5 key has 32 hexadecimal
public boolean isMD5(String s) { return s.matches("[a-fA-F0-9]{32}"); }

Advertisements
SHA1 key has 40 hexadecimal
public boolean isSHA1(String s) { return s.matches("[a-fA-F0-9]{40}"); }
MD5 key has 32 hexadecimal
public boolean isMD5(String s) { return s.matches("[a-fA-F0-9]{32}"); }