dat-encoding
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -15,3 +15,4 @@ 'use strict' | ||
exports.decode = function (str) { | ||
if (str.length === 64) return Buffer.from(str, 'hex') | ||
return Buffer.from(encoding.decode(str)) | ||
} |
{ | ||
"name": "dat-encoding", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "juliangruber/dat-encoding", |
@@ -14,2 +14,9 @@ var test = require('tape') | ||
t.deepEqual(enc.decode('42n3t'), Buffer('hey')) | ||
var legacy = { | ||
raw: Buffer('abcdabcdbacdbacdbacdbacdbacdbacd'), | ||
encoded: '6162636461626364626163646261636462616364626163646261636462616364' | ||
} | ||
t.deepEqual(enc.decode(legacy.encoded), legacy.raw, 'legacy hex encoding') | ||
t.end() | ||
@@ -16,0 +23,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2281
40