Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
bstring
Advanced tools
Readme
String encodings for javascript.
'use strict';
const assert = require('assert');
const {base58, bech32, cashaddr} = require('bstring');
// Base58
const b58 = base58.encode(Buffer.from([1,2,3]));
assert(base58.test(b58));
const data = base58.decode(b58);
console.log(data);
// Bech32
const b32 = bech32.encode('bc', 0, Buffer.alloc(20, 0x10));
assert(bech32.test(b32));
const {hrp, version, hash} = bech32.decode(b32);
console.log([hrp, version, hash]);
// CashAddr
const address = cashaddr.encode('bitcoincash', 0, Buffer.alloc(20, 0x10));
assert(cashaddr.test(address));
const res1 = cashaddr.decode(address);
console.log([res1.prefix, res1.type, res1.hash]);
const noPrefixAddress = address.split(':')[1];
assert(cashaddr.test(noPrefixAddress, 'bitcoincash'));
const res2 = cashaddr.decode(noPrefixAddress, 'bitcoincash');
console.log([res2.prefix, res2.type, res2.hash]);
If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. </legalese>
See LICENSE for more info.
FAQs
String encodings for javascript
We found that bstring 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.