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

dat-encoding

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-encoding - npm Package Compare versions

Comparing version 4.0.2 to 5.0.0

4

index.js

@@ -15,4 +15,4 @@ 'use strict'

if (typeof str !== 'string') throw new Error('Not a string')
var match = /\/?([^/]{64})/.exec(str)
if (!match) throw new Error('Invalid key')
var match = /\/?([^/]{64,65})/.exec(str)
if (!match || match[1].length !== 64) throw new Error('Invalid key')
return Buffer.from(match[1], 'hex')

@@ -19,0 +19,0 @@ }

{
"name": "dat-encoding",
"version": "4.0.2",
"version": "5.0.0",
"license": "MIT",

@@ -11,3 +11,3 @@ "repository": "juliangruber/dat-encoding",

"devDependencies": {
"standard": "^8.2.0",
"standard": "^9.0.0",
"tape": "^4.5.1"

@@ -14,0 +14,0 @@ },

@@ -12,2 +12,10 @@ var test = require('tape')

{type: 'valid', key: 'host.com/whatever/6161616161616161616161616161616161616161616161616161616161616161'},
{type: 'invalid', key: 'z6161616161616161616161616161616161616161616161616161616161616161'},
{type: 'invalid', key: '6161616161616161616161616161z616161616161616161616161616161616161'},
{type: 'invalid', key: '6161616161616161616161616161616161616161616161616161616161616161z'},
{type: 'invalid', key: '616161616161616161616161616161616161616161616161616161616161616'},
{type: 'invalid', key: '61616161616161616161616161616161616161616161616161616161616161601'},
{type: 'invalid', key: '616161616161616161616161616161616161616161616161616161616161616012'},
{type: 'invalid', key: '6161616161616161616161616161616161616161616161616161616161616160123'},
{type: 'invalid', key: '61616161616161616161616161616161616161616161616161616161616161601234'},
{type: 'invalid', key: new Buffer('key-me-maybe', 'hex')},

@@ -14,0 +22,0 @@ {type: 'invalid', key: 'key-me-maybe'},

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