Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for toZeroPaddedString (0.18 sec)

  1. platforms/core-execution/hashing/src/test/groovy/org/gradle/internal/hash/HashCodeTest.groovy

            expect:
            HashCode.fromString("12345678").toZeroPaddedString(8) == "12345678"
            HashCode.fromString("12345678").toZeroPaddedString(7) == "12345678"
            HashCode.fromString("12345678").toZeroPaddedString(0) == "12345678"
            HashCode.fromString("12345678").toZeroPaddedString(9) == "012345678"
            HashCode.fromString("12345678").toZeroPaddedString(16) == "0000000012345678"
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:43:29 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  2. testing/internal-integ-testing/src/main/groovy/org/gradle/test/fixtures/AbstractModule.groovy

        }
    
        private TestFile hashFile(TestFile file, HashFunction hashFunction) {
            def hashFile = getHashFile(file, hashFunction)
            def hash = hashFunction.hashFile(file)
            hashFile.text = hash.toZeroPaddedString(hashFunction.hexDigits)
            return hashFile
        }
    
        private TestFile getHashFile(TestFile file, HashFunction hashFunction) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. platforms/software/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/caching/CachedDependencyResolutionIntegrationTest.groovy

            server.sendLastModified = false
            byte[] jarBytes = [0, 0, 0, 5] // this should produce leading zeros
            module.jarFile.bytes = jarBytes
            sha1.text = Hashing.sha1().hashBytes(jarBytes).toZeroPaddedString(Hashing.sha1().hexDigits)
            initialResolve()
            expect:
            headThenSha1Requests()
            trimLeadingZerosFromSHA1(sha1)
            unchangedResolve()
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  4. platforms/core-runtime/wrapper-main/src/integTest/groovy/org/gradle/integtests/WrapperChecksumVerificationTest.groovy

        }
    
        static String getDistributionHash(GradleDistribution distribution) {
            sha256().hashFile(distribution.binDistribution).toZeroPaddedString(sha256().hexDigits)
        }
    
        def "wrapper preserves new checksum if it was provided in properties"() {
            given:
            configureServer(false)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu May 23 05:54:32 UTC 2024
    - 6K bytes
    - Viewed (0)
  5. platforms/core-runtime/wrapper-shared/src/test/groovy/org/gradle/wrapper/InstallTest.groovy

            new byte[0]                     | "empty file"
            getEvilTarData()                | "evil tar"
        }
    
        private calcHash(byte[] bytes) {
            sha256().hashBytes(bytes).toZeroPaddedString(sha256().hexDigits)
        }
    
        def "successfully get distribution hash"() {
            when:
    
            def hash = install.fetchDistributionSha256Sum(configuration, new TestFile(zipStore, zipFileName))
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:12:34 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  6. platforms/software/maven/src/main/java/org/gradle/api/publish/maven/internal/publisher/AbstractMavenPublisher.java

                    hash = hashFunction.hashFile(src);
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
                String formattedHashString = hash.toZeroPaddedString(hashFunction.getHexDigits());
                return formattedHashString.getBytes(StandardCharsets.US_ASCII);
            }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Mar 07 12:20:56 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  7. platforms/core-execution/hashing/src/main/java/org/gradle/internal/hash/HashCode.java

         * }</pre>
         */
        @Override
        public String toString() {
            StringBuilder sb = toStringBuilder(2 * length(), bytes());
            return sb.toString();
        }
    
        public String toZeroPaddedString(int length) {
            StringBuilder sb = toStringBuilder(length, bytes());
            while (sb.length() < length) {
                sb.insert(0, '0');
            }
            return sb.toString();
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Dec 14 19:25:07 UTC 2023
    - 10.9K bytes
    - Viewed (0)
  8. testing/internal-integ-testing/src/main/groovy/org/gradle/test/fixtures/server/http/HttpServer.groovy

            response.setContentType(contentType ?: new MimeTypes().getMimeByExtension(file.name).toString())
            if (sendSha1Header) {
                response.addHeader("X-Checksum-Sha1", Hashing.sha1().hashBytes(content).toZeroPaddedString(Hashing.sha1().hexDigits))
            }
    
            addEtag(response, content, etags)
            response.outputStream << content
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 32.3K bytes
    - Viewed (0)
Back to top