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

butt64

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

butt64

test wether a butt64 string will serialize the same after parsing

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

butt64

Based on is-canonical-base64 but modified to generate regular expressions for url-safe base64, as described in ssb-uri spec :

URI-safe Base64 is equivalent to Base64 where + characters are replaced with -, and / characters are replaced with _.

Example Usage

const Butt64 = require('butt64')

const regex = new Butt64('ssb:feed/classic/, null, 32)

regex.test('ssb:feed/classic/-oaWWDs8g73EZFUMfW37R_ULtFEjwKN_DczvdYihjbU=')
// => true

API

new Butt64(prefix, suffix, length) => RegExp

All arguments are optional

  • prefix String or Pattern to require at the beginning of string
  • suffix String or Pattern pattern to require at the end of string
  • length Integer the length of the data in bytes you're expected to be encoded

Butt64.bufferToButt64(buffer) => string

Converts a buffer ing a base64 encoded string.

Butt64.butt64ToBuffer(string) => buffer

Converts a butt64 encoded string into a buffer.

License

MIT

FAQs

Package last updated on 05 Apr 2023

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