@Nullable public static HKey psiKey(@NotNull PsiMethod psiMethod,@NotNull Direction direction,@NotNull MessageDigest md){
  final PsiClass psiClass=PsiTreeUtil.getParentOfType(psiMethod,PsiClass.class,false);
  if (psiClass == null) {
    return null;
  }
  byte[] classDigest=psiClassDigest(psiClass,md);
  if (classDigest == null) {
    return null;
  }
  byte[] sigDigest=methodDigest(psiMethod,md);
  if (sigDigest == null) {
    return null;
  }
  byte[] digest=new byte[HASH_SIZE];
  System.arraycopy(classDigest,0,digest,0,CLASS_HASH_SIZE);
  System.arraycopy(sigDigest,0,digest,CLASS_HASH_SIZE,SIGNATURE_HASH_SIZE);
  return new HKey(digest,mkDirectionKey(direction),true);
}

@ Nullable public static HKey psiKey ( @ NotNull PsiMethod psiMethod , @ NotNull Direction direction , @ NotNull MessageDigest md ) { final PsiClass psiClass = PsiTreeUtil . getParentOfType ( psiMethod , PsiClass . class , false ) ; if ( psiClass == null ) { return null ; } byte [ ] classDigest = psiClassDigest ( psiClass , md ) ; if ( classDigest == null ) { return null ; } byte [ ] sigDigest = methodDigest ( psiMethod , md ) ; if ( sigDigest == null ) { return null ; } byte [ ] digest = new byte [ HASH_SIZE ] ; System . arraycopy ( classDigest , 0 , digest , 0 , CLASS_HASH_SIZE ) ; System . arraycopy ( sigDigest , 0 , digest , CLASS_HASH_SIZE , SIGNATURE_HASH_SIZE ) ; return new HKey ( digest , mkDirectionKey ( direction ) , true ) ; }
converts a psi method to a small hash key ( hkey ) . returns null if conversion is impossible ( something is not resolvable ) .
