\href{https://www.npmjs.org/package/sha.js}{\texttt{ }} \href{https://travis-ci.org/crypto-browserify/sha.js}{\texttt{ }} \href{https://david-dm.org/crypto-browserify/sha.js\#info=dependencies}{\texttt{ }}

\href{https://github.com/feross/standard}{\texttt{ }}

Node style {\ttfamily SHA} on pure Java\+Script.


\begin{DoxyCode}{0}
\DoxyCodeLine{var shajs = require('sha.js')}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(shajs('sha256').update('42').digest('hex'))}
\DoxyCodeLine{// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049}
\DoxyCodeLine{console.log(new shajs.sha256().update('42').digest('hex'))}
\DoxyCodeLine{// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049}
\DoxyCodeLine{}
\DoxyCodeLine{var sha256stream = shajs('sha256')}
\DoxyCodeLine{sha256stream.end('42')}
\DoxyCodeLine{console.log(sha256stream.read().toString('hex'))}
\DoxyCodeLine{// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_sha_js_README_autotoc_md26998}{}\doxysection{supported hashes}\label{md_sfcode_node_modules_sha_js_README_autotoc_md26998}
{\ttfamily sha.\+js} currently implements\+:


\begin{DoxyItemize}
\item SHA (SHA-\/0) -- {\bfseries{legacy, do not use in new systems}}
\item SHA-\/1 -- {\bfseries{legacy, do not use in new systems}}
\item SHA-\/224
\item SHA-\/256
\item SHA-\/384
\item SHA-\/512
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_sha_js_README_autotoc_md26999}{}\doxysection{Not an actual stream}\label{md_sfcode_node_modules_sha_js_README_autotoc_md26999}
Note, this doesn\textquotesingle{}t actually implement a stream, but wrapping this in a stream is trivial. It does update incrementally, so you can hash things larger than RAM, as it uses a constant amount of memory (except when using base64 or utf8 encoding, see code comments).\hypertarget{md_sfcode_node_modules_sha_js_README_autotoc_md27000}{}\doxysection{Acknowledgements}\label{md_sfcode_node_modules_sha_js_README_autotoc_md27000}
This work is derived from Paul Johnston\textquotesingle{}s \href{http://pajhome.org.uk/crypt/md5/sha1.html}{\texttt{ A Java\+Script implementation of the Secure Hash Algorithm}}.\hypertarget{md_sfcode_node_modules_sha_js_README_autotoc_md27001}{}\doxysection{LICENSE \mbox{[}\+MIT\mbox{]}(\+LICENSE)}\label{md_sfcode_node_modules_sha_js_README_autotoc_md27001}
