N
N
Nikita Tratorov2017-01-20 00:25:59
PHP
Nikita Tratorov, 2017-01-20 00:25:59

How to calculate SRI integrity for JS file in PHP?

I was looking for a solution in the open spaces, but there was no working option that would give out the same thing as https://www.srihash.org/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-01-20
@NikitaTratorov

also possible like this:

echo 'sha384-' . base64_encode(hash_file('sha384', 'path-to-file', true));
// или
echo 'sha384-' . base64_encode(hash('sha384', file_get_contents('path-to-file'), true));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question