Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pvutils

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pvutils

Common utilities for products from Peculiar Ventures

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-45.42%
Maintainers
2
Weekly downloads
 
Created

What is pvutils?

The pvutils npm package provides a set of utility functions for working with ASN.1 and DER encoded data, commonly used in cryptographic applications. It simplifies the process of encoding and decoding data structures, making it easier to handle complex binary data formats.

What are pvutils's main functionalities?

Buffer Concatenation

This feature allows you to concatenate multiple ArrayBuffer objects into a single ArrayBuffer. It is useful when you need to combine binary data from different sources.

const pvutils = require('pvutils');
const buffer1 = new Uint8Array([1, 2, 3]);
const buffer2 = new Uint8Array([4, 5, 6]);
const concatenatedBuffer = pvutils.utilConcatBuf(buffer1.buffer, buffer2.buffer);
console.log(new Uint8Array(concatenatedBuffer));

String to ArrayBuffer Conversion

This feature converts a string into an ArrayBuffer, which is useful for encoding text data into a binary format.

const pvutils = require('pvutils');
const str = 'Hello, World!';
const arrayBuffer = pvutils.stringToArrayBuffer(str);
console.log(new Uint8Array(arrayBuffer));

ArrayBuffer to String Conversion

This feature converts an ArrayBuffer back into a string, which is useful for decoding binary data back into a readable text format.

const pvutils = require('pvutils');
const buffer = new Uint8Array([72, 101, 108, 108, 111]).buffer;
const str = pvutils.arrayBufferToString(buffer);
console.log(str);

Hexadecimal Encoding

This feature converts an ArrayBuffer into a hexadecimal string representation, which is useful for debugging and displaying binary data in a human-readable format.

const pvutils = require('pvutils');
const buffer = new Uint8Array([255, 0, 128]).buffer;
const hexString = pvutils.bufferToHexCodes(buffer);
console.log(hexString);

Other packages similar to pvutils

FAQs

Package last updated on 02 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc