multiformats
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -102,3 +102,3 @@ const varints = require('varint') | ||
const { decode } = get(prefix) | ||
return decode(string) | ||
return Uint8Array.from(decode(string)) | ||
} | ||
@@ -105,0 +105,0 @@ const encoding = string => get(string[0]) |
{ | ||
"name": "multiformats", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Interface for multihash, multicodec, multibase and CID.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,2 +34,9 @@ /* globals describe, it */ | ||
}) | ||
test('pristine backing buffer', () => { | ||
// some deepEqual() libraries go as deep as the backing buffer, make sure it's pristine | ||
const string = multibase.encode(bytes.fromString('test'), base) | ||
const buffer = multibase.decode(string) | ||
const expected = bytes.fromString('test') | ||
same(new Uint8Array(buffer.buffer).join(','), new Uint8Array(expected.buffer).join(',')) | ||
}) | ||
test('empty', () => { | ||
@@ -36,0 +43,0 @@ const str = multibase.encode(bytes.fromString(''), base) |
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
57202
1508