public static String fileBuilderUrl(String baseUri,String seed,byte[] signatureSecret,long fileId,long fileAccessHash){
  byte[] seedBytes=decodeHex(seed.toCharArray());
  byte[] fileIdBytes=getBytes(fileId);
  byte[] accessHashBytes=getBytes(fileAccessHash);
  byte[] bytesToSign=ArrayUtils.addAll(ArrayUtils.addAll(seedBytes,fileIdBytes),accessHashBytes);
  String signPart=HmacUtils.hmacSha256Hex(signatureSecret,bytesToSign);
  String signature=seed + "_" + signPart;
  return baseUri + "/" + fileId+ "?signature="+ signature;
}

public static String fileBuilderUrl ( String baseUri , String seed , byte [ ] signatureSecret , long fileId , long fileAccessHash ) { byte [ ] seedBytes = decodeHex ( seed . toCharArray ( ) ) ; byte [ ] fileIdBytes = getBytes ( fileId ) ; byte [ ] accessHashBytes = getBytes ( fileAccessHash ) ; byte [ ] bytesToSign = ArrayUtils . addAll ( ArrayUtils . addAll ( seedBytes , fileIdBytes ) , accessHashBytes ) ; String signPart = HmacUtils . hmacSha256Hex ( signatureSecret , bytesToSign ) ; String signature = seed + "_" + signPart ; return baseUri + "/" + fileId + "?signature=" + signature ; }
returns url with calculated signature for specific file with specific file builder parameters
