Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
sha256-wasm
Advanced tools
const sha256 = require('sha256-wasm')
if (!Sha256.SUPPORTED) {
console.log('WebAssembly not supported by your runtime')
}
var hash = sha256()
.update('hello')
.update(' ')
.update(Buffer.from('world'))
.digest('hex')
console.log('Sha256 hash of "hello world" is ', hash)
// b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
const hash = sha256()
Create a new hash instance.
hash.update(data, [enc])
Update the hash with a new piece of data. data
may be passed as a buffer, uint8array or a string. If data
is passed as a string, then it will be interpreted as a utf8
string unless enc
specifies an encoding.
Supported enc
s are:
utf8
/ utf-8
(defualt)hex
base64
hash.digest([enc])
Digest the hash. If enc
is specified, then the digest shall be returned as an enc
encoded string. Otherwise a buffer is returned.
Supported enc
s are:
utf8
/ utf-8
(defualt)hex
base64
var promise = sha256.ready([cb])
Wait for the WASM code to load. Returns the WebAssembly instance promise as well for convenience. You have to call this at least once before instantiating the hash.
The bulk of this module is implemented in WebAssembly in the sha256.wat file. To build the thin Javascript wrapper do:
npm run compile
MIT
FAQs
WebAssembly implementation of SHA-256
We found that sha256-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.