<commit_before>{{! This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at https://mozilla.org/MPL/2.0/. }}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{{title}}</title>
    <link rel="canonical" href="https://www.srihash.org"/>
    <link rel="stylesheet" href="/style.css" integrity="{{sri './public/style.css'}}">
    <link rel="stylesheet" href="/badge/badge.css" integrity="{{sri './public/badge/badge.css'}}">
    <link rel="stylesheet" href="/badge/will-pass.css">
    <link rel="stylesheet" href="/badge/must-fail.css" integrity="sha384-INVALIDHASH">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
  </head>
  <body>
    <!-- Nav -->
    <nav>
      <a href="#about">About</a>
      <a href="#app">Hash Generator</a>
      <br class="clear">
    </nav>

    <!-- Banner -->
    <div id="app" class="container">
      <div class="container" id="sriAppContainer">
        {{! section to be replaced with react app }}
        <div id="sriApp">
          <h1>SRI Hash Generator</h1>
          <label for="url">Enter the URL of the resource you wish to use:</label>
          <form method="POST" action="/hash" target="sriSnippet">
            <input id="url" name="url" type="url" value="" placeholder="Resource URL" required autofocus>
            <input name="algorithms" type="hidden" value="sha384">
            <input type="submit" value="Hash!">
          </form>
          <iframe id="sriSnippet" name="sriSnippet" sandbox="allow-same-origin" title="SRI Hash"></iframe>
        </div>
        {{! end section }}
      </div>
    </div>

    <!-- About -->
    <section id="about" class="container">
      <h2>What is Subresource Integrity?</h2>
      <p>SRI is a new <a href="https://www.w3.org/TR/SRI/">W3C specification</a> that allows web developers to ensure that resources hosted on third-party servers have not been tampered with. Use of SRI is recommended as a best-practice, whenever libraries are loaded from a third-party source.</p>
      <p>Learn more about <a href="https://developer.mozilla.org/docs/Web/Security/Subresource_Integrity">how to use subresource integrity</a> on MDN.</p>
      <hr>

      <h2>How is Subresource Integrity different to HTTPS?</h2>
      <p>TLS ensures that the connection between the browser and the server is secure. The resource itself may still be modified server-side by an attacker to include malicious content, yet still be served with a valid TLS certificate. SRI, on the other hand, guarantees that a resource hasn't changed since it was hashed by a web author.</p>
      <hr>

      <h2>How can I generate Integrity hashes?</h2>
      <p>Use the generator above or the following shell command:<br>
        <code>
          openssl dgst -sha384 -binary <strong>FILENAME.js</strong> | openssl base64 -A
        </code>
      </p>

      <hr>

      <h2>Test your browser</h2>
      <p>Check out <a href="https://caniuse.com/#feat=subresource-integrity">SRI on caniuse.com</a> to see specific browser version support information.</p>

      <p>To fully test your browser for subresource integrity support, please open <a href="http://w3c-test.org/subresource-integrity/subresource-integrity.sub.html">this page</a>.</p>

      <div class="sri-test" id="sri-badge">
        <div data-sri-status="pass">
          <img src="/badge/pass.svg" alt="Pass Badge" width="50" height="64">
          <p>Your browser supports SRI</p>
        </div>
        <div data-sri-status="fail">
          <img src="/badge/fail.svg" alt="Fail Badge" width="50" height="64">
          <p>Your browser does not support SRI</p>
        </div>
      </div>
    </section>

    <hr>

    <!-- Footer -->
    <footer class="container">
      The code behind this service is hosted on <a href="https://github.com/mozilla/srihash.org">GitHub</a> and is licensed under the <a href="https://www.mozilla.org/MPL/2.0/">Mozilla Public License 2.0</a>.
    </footer>

  </body>
</html><commit_msg>Use https. (#255)<commit_after>{{! This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at https://mozilla.org/MPL/2.0/. }}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{{title}}</title>
    <link rel="canonical" href="https://www.srihash.org"/>
    <link rel="stylesheet" href="/style.css" integrity="{{sri './public/style.css'}}">
    <link rel="stylesheet" href="/badge/badge.css" integrity="{{sri './public/badge/badge.css'}}">
    <link rel="stylesheet" href="/badge/will-pass.css">
    <link rel="stylesheet" href="/badge/must-fail.css" integrity="sha384-INVALIDHASH">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
  </head>
  <body>
    <!-- Nav -->
    <nav>
      <a href="#about">About</a>
      <a href="#app">Hash Generator</a>
      <br class="clear">
    </nav>

    <!-- Banner -->
    <div id="app" class="container">
      <div class="container" id="sriAppContainer">
        {{! section to be replaced with react app }}
        <div id="sriApp">
          <h1>SRI Hash Generator</h1>
          <label for="url">Enter the URL of the resource you wish to use:</label>
          <form method="POST" action="/hash" target="sriSnippet">
            <input id="url" name="url" type="url" value="" placeholder="Resource URL" required autofocus>
            <input name="algorithms" type="hidden" value="sha384">
            <input type="submit" value="Hash!">
          </form>
          <iframe id="sriSnippet" name="sriSnippet" sandbox="allow-same-origin" title="SRI Hash"></iframe>
        </div>
        {{! end section }}
      </div>
    </div>

    <!-- About -->
    <section id="about" class="container">
      <h2>What is Subresource Integrity?</h2>
      <p>SRI is a new <a href="https://www.w3.org/TR/SRI/">W3C specification</a> that allows web developers to ensure that resources hosted on third-party servers have not been tampered with. Use of SRI is recommended as a best-practice, whenever libraries are loaded from a third-party source.</p>
      <p>Learn more about <a href="https://developer.mozilla.org/docs/Web/Security/Subresource_Integrity">how to use subresource integrity</a> on MDN.</p>
      <hr>

      <h2>How is Subresource Integrity different to HTTPS?</h2>
      <p>TLS ensures that the connection between the browser and the server is secure. The resource itself may still be modified server-side by an attacker to include malicious content, yet still be served with a valid TLS certificate. SRI, on the other hand, guarantees that a resource hasn't changed since it was hashed by a web author.</p>
      <hr>

      <h2>How can I generate Integrity hashes?</h2>
      <p>Use the generator above or the following shell command:<br>
        <code>
          openssl dgst -sha384 -binary <strong>FILENAME.js</strong> | openssl base64 -A
        </code>
      </p>

      <hr>

      <h2>Test your browser</h2>
      <p>Check out <a href="https://caniuse.com/#feat=subresource-integrity">SRI on caniuse.com</a> to see specific browser version support information.</p>

      <p>To fully test your browser for subresource integrity support, please open <a href="https://w3c-test.org/subresource-integrity/subresource-integrity.sub.html">this page</a>.</p>

      <div class="sri-test" id="sri-badge">
        <div data-sri-status="pass">
          <img src="/badge/pass.svg" alt="Pass Badge" width="50" height="64">
          <p>Your browser supports SRI</p>
        </div>
        <div data-sri-status="fail">
          <img src="/badge/fail.svg" alt="Fail Badge" width="50" height="64">
          <p>Your browser does not support SRI</p>
        </div>
      </div>
    </section>

    <hr>

    <!-- Footer -->
    <footer class="container">
      The code behind this service is hosted on <a href="https://github.com/mozilla/srihash.org">GitHub</a> and is licensed under the <a href="https://www.mozilla.org/MPL/2.0/">Mozilla Public License 2.0</a>.
    </footer>

  </body>
</html>
{'fraction_non_alphanumeric': 0.15756126718469815, 'fraction_numerical': 0.010400478182904961, 'mean_word_length': 2.9990439770554493, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 207, 'https://': 15, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2445380', 'n_tokens_mistral': 2710, 'n_tokens_neox': 2587, 'n_words': 775}