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

bs58check

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs58check - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

18

index.js

@@ -22,6 +22,3 @@ 'use strict'

// Decode a base58-check encoded string to a buffer, no result if checksum is wrong
function decodeUnsafe (string) {
var buffer = new Buffer(base58.decode(string))
function decodeRaw (buffer) {
var payload = buffer.slice(0, -4)

@@ -39,4 +36,15 @@ var checksum = buffer.slice(-4)

// Decode a base58-check encoded string to a buffer, no result if checksum is wrong
function decodeUnsafe (string) {
var array = base58.decodeUnsafe(string)
if (!array) return
var buffer = new Buffer(array)
return decodeRaw(buffer)
}
function decode (string) {
var payload = decodeUnsafe(string)
var array = base58.decode(string)
var buffer = new Buffer(array)
var payload = decodeRaw(buffer)
if (!payload) throw new Error('Invalid checksum')

@@ -43,0 +51,0 @@ return payload

{
"name": "bs58check",
"version": "1.3.0",
"version": "1.3.1",
"description": "A straightforward implementation of base58-check encoding",

@@ -41,3 +41,3 @@ "keywords": [

"dependencies": {
"bs58": "^2.0.1",
"bs58": "^3.1.0",
"create-hash": "^1.1.0"

@@ -44,0 +44,0 @@ },

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