Skip to content

Commit 317cb2a

Browse files
authored
download: Reword CDN paragraph (#39179)
1 parent 8df9899 commit 317cb2a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"dropright",
4141
"dropstart",
4242
"dropup",
43+
"dgst",
4344
"errorf",
4445
"favicon",
4546
"favicons",

site/content/docs/5.3/getting-started/download.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,19 @@ If you're using our compiled JavaScript and prefer to include Popper separately,
5454

5555
We recommend [jsDelivr](https://www.jsdelivr.com/) and use it ourselves in our documentation. However, in some cases—like in some specific countries or environments—you may need to use other CDN providers like [cdnjs](https://cdnjs.com/) or [unpkg](https://unpkg.com/).
5656

57-
You'll find the same files on these CDN providers, albeit with different URLs. When changing the URLs, you'll also need to update the `integrity` attribute. Tools like [SRI Hash Generator](https://www.srihash.org/) can help you generate the correct values.
57+
You'll find the same files on these CDN providers, albeit with different URLs. With cdnjs, you can [use this direct Bootstrap package link](https://cdnjs.com/libraries/bootstrap) to copy and paste ready-to-use HTML snippets for each dist file from any version of Bootstrap.
5858

59-
With cdnjs, you can [use this direct Bootstrap package link](https://cdnjs.com/libraries/bootstrap) to copy and paste ready-to-use HTML snippets for each dist file from any version of Bootstrap.
59+
{{< callout warning>}}
60+
**If the SRI hashes differ for a given file, you shouldn't use the files from that CDN, because it means that the file was modified by someone else.**
61+
{{< /callout >}}
62+
63+
Note that you should compare same length hashes, e.g. `sha384` with `sha384`, otherwise it's expected for them to be different.
64+
As such, you can use an online tool like [SRI Hash Generator](https://www.srihash.org/) to make sure that the hashes are the same for a given file.
65+
Alternatively, assuming you have OpenSSL installed, you can achieve the same from the CLI, for example:
66+
67+
```sh
68+
openssl dgst -sha384 -binary bootstrap.min.js | openssl base64 -A
69+
```
6070

6171
## Package managers
6272

0 commit comments

Comments
 (0)