//npm install hash.js
const hash = require('hash.js')
hash.sha256().update(foo).digest('hex')