Генератор Subresource Integrity
Создаёт значения SRI для загруженных файлов.
Как использовать Генератор Subresource Integrity
Subresource integrity generator hashes a script, stylesheet or other file you select and returns an integrity value, such as sha384- followed by the base64 digest, ready for an integrity attribute. Choose SHA-384, the default, or SHA-256 or SHA-512. For cross-origin assets, pair it with the crossorigin attribute set to anonymous and confirm the server supports CORS.
- Выберите исходный файл. Если инструмент принимает несколько файлов, расположите их в нужном порядке.
- Укажите алгоритм.
- Запустите «Генератор Subresource Integrity», просмотрите результат и используйте доступные элементы копирования или скачивания.
Что поддерживает этот инструмент
Создаёт значения SRI для загруженных файлов.
- Алгоритм
- SHA-384 · SHA-256 · SHA-512
Ограничения и обработка
До 200 файлов по 20 МБ каждый, суммарно до 100 МБ. PDF ограничены 500 страницами, контактные листы — 100 страницами, деревья закладок — 1 000 элементов и 20 уровней вложенности. Отдельные операции применяют меньшие ограничения на результат.
Частые вопросы
Which hash algorithm should I choose for SRI?
SHA-384 is selected by default, and SHA-256 and SHA-512 are also available; all three are accepted in integrity attributes. The prefix in the output, such as sha512-, tells the browser which algorithm produced the digest.
Why does my SRI hash not match the CDN file?
The hash covers the exact bytes of the file you select. If the CDN serves a different version, build or line endings than your local copy, the values differ. Download the exact file URL you reference and hash that copy.
How do I add the integrity value to a script tag?
Copy the output into the integrity attribute of the script or link element. For files loaded from another origin, also add the crossorigin attribute with the value anonymous, which requires the server to send CORS headers.
Где обрабатываются мои данные?
Эта операция обрабатывает исходные данные в вашем браузере. Копирование и скачивание выполняются только по вашему действию; входные данные не сохраняются в учётной записи или истории.
Каковы ограничения входных данных?
До 200 файлов по 20 МБ каждый, суммарно до 100 МБ. PDF ограничены 500 страницами, контактные листы — 100 страницами, деревья закладок — 1 000 элементов и 20 уровней вложенности. Отдельные операции применяют меньшие ограничения на результат.