public static boolean isMagic(byte[] peerid) 
	throws java.security.NoSuchAlgorithmException {
		if (peerid==null) return false;
		MessageDigest md = MessageDigest.getInstance("SHA-1");
		md.update(peerid);
		byte[] digest = md.digest();
		int magic = (digest[digest.length-2] << Byte.SIZE) | digest[digest.length-1];
		return (magic & 0xFFFF) != 0;
	}