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

@sapphirecode/encoding-helper

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sapphirecode/encoding-helper

Converting strings between different encodings

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

@sapphirecode/encoding-helper

version: 1.1.x

Converting strings between different encodings

Installation

npm:

npm i --save @sapphirecode/encoding-helper

yarn:

yarn add @sapphirecode/encoding-helper

Usage

const encoding = require('@sapphirecode/encoding-helper');

const hex = encoding.to_hex('abc'); // convert any encoding to hex, default is utf-8
const b64 = encoding.to_b64(hex, 'hex'); // convert any encoding to base64, default is utf-8
const b58 = encoding.to_b58(hex, 'hex'); // convert any encoding to base58, default is utf-8
const utf8 = encoding.to_utf8(hex, 'hex'); // convert any encoding to utf-8, no default
const hexn = encoding.num_to_hex(10); // convert a number to hex
const num = encoding.hex_to_num('a'); // convert hex to a number

supported input encodings:

  • default supported by buffer:
    • ascii
    • base64
    • binary
    • hex
    • latin1
    • ucs-2
    • utf-8
    • utf16le
  • additional encodings:
    • base58

License

MIT © Timo Hocker timo@scode.ovh

Keywords

FAQs

Package last updated on 30 Dec 2020

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