code: public static UUID nameUUIDFromString(String name, UUID namespace, String encoding) {
  		byte[] nameAsBytes = name.getBytes();
  		byte[] concat = new byte[UUID_BYTE_LENGTH + nameAsBytes.length];
  		System.arraycopy(namespace.getRawBytes(), 0, concat, 0, UUID_BYTE_LENGTH);
  		System.arraycopy(nameAsBytes, 0, concat, UUID_BYTE_LENGTH, nameAsBytes.length);
  		
  		byte[] raw = null;
  		
  		if(encoding.equals(UUID.MD5_ENCODING)) {
  			raw = DigestUtils.md5(concat);
  		}
  		else if(encoding.equals(UUID.SHA1_ENCODING)) {
  			byte[] shaDigest = DigestUtils.sha(concat);
  			// Truncate digest to 16 bytes (SHA-1 returns a 20-byte digest)
  			raw = new byte[16];
  			System.arraycopy(shaDigest, 0, raw, 0, 16); 
  		}
  		else {
  			throw new RuntimeException("Unsupported encoding " + encoding);
  		}
  		
  		
  		//Set version (version 3 and version 5 are identical on a bit-level,
  		//thus we only need ever set one of them
  		raw[TIME_HI_AND_VERSION_BYTE_6] &= 0x0F;
  		raw[TIME_HI_AND_VERSION_BYTE_6] |= (UUID.VERSION_THREE << 4);
  		
  		//Set variant
  		raw[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] &= 0x3F; //0011 1111
  		raw[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] |= 0x80; //1000 0000
  		
  		return new UUID(raw);
  	}
docs: <p>Returns a new version three (MD5) or five (SHA-1) UUID, using the specified encoding
  given a name and the namespace's UUID.</p>
  
  @param name String the name to calculate the UUID for.
  @param namespace UUID assigned to this namespace.
  @param encoding The encoding to use, either #{link UUID.MD5_ENCODING} or #{link UUID.SHA1_ENCODING}
  @return a new version three UUID given a name and the namespace's UUID.