SHA-256 hash in pure javascript
npm install cross-sha256
Isomorphic SHA-256 with minimal dependencies. Uses the Node.js crypto module if available, otherwise uses a JS implementation (e.g. in browser environments).
``ts
import { sha256 } from 'cross-sha256'
console.log(new sha256().update('42').digest('hex'))
// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049
``