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 often miss.
@smithy/util-hex-encoding
Advanced tools
Converts binary buffers to and from lowercase hexadecimal encoding
@smithy/util-hex-encoding is a utility package for encoding and decoding hexadecimal strings. It is part of the Smithy framework, which is used for building SDKs and other tools.
Hex Encoding
This feature allows you to convert a buffer or byte array into a hexadecimal string.
const { toHex } = require('@smithy/util-hex-encoding');
const buffer = Buffer.from('hello');
const hexString = toHex(buffer);
console.log(hexString); // Output: 68656c6c6f
Hex Decoding
This feature allows you to convert a hexadecimal string back into a buffer or byte array.
const { fromHex } = require('@smithy/util-hex-encoding');
const hexString = '68656c6c6f';
const buffer = fromHex(hexString);
console.log(buffer.toString()); // Output: hello
The 'buffer' package is a core Node.js module that provides a way of handling binary data. It includes methods for converting buffers to and from hexadecimal strings, similar to @smithy/util-hex-encoding. However, 'buffer' is more comprehensive and includes additional functionalities for working with binary data.
The 'hex2ascii' package provides simple utilities for converting hexadecimal strings to ASCII and vice versa. It is similar to @smithy/util-hex-encoding but focuses specifically on ASCII conversions, making it less versatile for general binary data handling.
The 'crypto-js' package is a widely-used library for cryptographic algorithms. It includes utilities for encoding and decoding hexadecimal strings, among other features. Compared to @smithy/util-hex-encoding, 'crypto-js' offers a broader range of cryptographic functionalities.
FAQs
Converts binary buffers to and from lowercase hexadecimal encoding
The npm package @smithy/util-hex-encoding receives a total of 7,435,395 weekly downloads. As such, @smithy/util-hex-encoding popularity was classified as popular.
We found that @smithy/util-hex-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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 often 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.