Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools oft miss.
@bitgo-beta/blake2b-wasm
Advanced tools
Blake2b implemented in WASM
npm install @bitgo/blake2b-wasm
Works in browsers that support WASM and Node.js 8+.
var blake2b = require('@bitgo/blake2b-wasm')
if (!blake2b.SUPPORTED) {
console.log('WebAssembly not supported by your runtime')
}
blake2b.ready(function (err) {
if (err) throw err
var hash = blake2b()
.update(Buffer.from('hello')) // pass in a buffer or uint8array
.update(Buffer.from(' '))
.update(Buffer.from('world'))
.digest('hex')
console.log('Blake2b hash of "hello world" is %s', hash)
})
var hash = blake2b([digestLength], [key], [salt], [personal])
Create a new hash instance. digestLength
defaults to 32
.
hash.update(data)
Update the hash with a new piece of data. data
should be a buffer or uint8array.
var digest = hash.digest([enc])
Digest the hash.
var promise = blake2b.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.
There is a browser example included in example.html and example.js.
The bulk of this module is implemented in WebAssembly in the blake2b.wat file. The format of this file is S-Expressions that can be compiled to their binary WASM representation by doing
wat2wasm blake2b.wat -o blake2b.wasm
To build the thin JavaScript wrapper for the WASM module use wat2js
:
# also available as `npm run compile`
wat2js blake2b.wat -o blake2b.js
If you do not have wat2wasm
installed follow the instructions here, https://github.com/WebAssembly/wabt
MIT
FAQs
Blake2b implemented in WASM
The npm package @bitgo-beta/blake2b-wasm receives a total of 16,729 weekly downloads. As such, @bitgo-beta/blake2b-wasm popularity was classified as popular.
We found that @bitgo-beta/blake2b-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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools oft miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.