Code example for BigInteger

Methods: hashCode

0
        return p.equals(o.p) && q.equals(o.q) && g.equals(o.g);
    } 
 
    @Override 
	public int hashCode() { 
        return p.hashCode() ^ q.hashCode() ^ g.hashCode();
    } 
     
	public SimpleFieldSet asFieldSet() { 
		SimpleFieldSet fs = new SimpleFieldSet(true);
		fs.putSingle("p", Base64.encode(p.toByteArray()));
		fs.putSingle("q", Base64.encode(q.toByteArray()));
		fs.putSingle("g", Base64.encode(g.toByteArray()));
		return fs;
	} 
 
	public static DSAGroup create(SimpleFieldSet fs) throws IllegalBase64Exception, FSParseException {
		String myP = fs.get("p");
		String myQ = fs.get("q");
		String myG = fs.get("g");
		if(myP == null || myQ == null || myG == null) throw new FSParseException("The given SFS doesn't contain required fields!");