@dxos/crypto
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -12,6 +12,6 @@ /** | ||
/** | ||
* @param {Buffer} value | ||
* @param {Buffer|Uint8Array} value | ||
* @return {string|Buffer} | ||
*/ | ||
export function humanize(value: Buffer): string | Buffer; | ||
export function humanize(value: Buffer | Uint8Array): string | Buffer; | ||
/** | ||
@@ -18,0 +18,0 @@ * Return random bytes of length. |
@@ -40,3 +40,3 @@ "use strict"; | ||
if (buffer instanceof Uint8Array) { | ||
buffer = buffer.from(Uint8Array); | ||
buffer = Buffer.from(buffer); | ||
} | ||
@@ -48,6 +48,9 @@ assert_1.default(buffer instanceof Buffer, 'Invalid type'); | ||
/** | ||
* @param {Buffer} value | ||
* @param {Buffer|Uint8Array} value | ||
* @return {string|Buffer} | ||
*/ | ||
function humanize(value) { | ||
if (value instanceof Uint8Array) { | ||
value = Buffer.from(value); | ||
} | ||
if (value instanceof Buffer) { | ||
@@ -54,0 +57,0 @@ value = keyToString(value); |
{ | ||
"name": "@dxos/crypto", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Basic crypto key utils", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -41,3 +41,3 @@ // | ||
if (buffer instanceof Uint8Array) { | ||
buffer = buffer.from(Uint8Array); | ||
buffer = Buffer.from(buffer); | ||
} | ||
@@ -49,6 +49,9 @@ assert(buffer instanceof Buffer, 'Invalid type'); | ||
/** | ||
* @param {Buffer} value | ||
* @param {Buffer|Uint8Array} value | ||
* @return {string|Buffer} | ||
*/ | ||
export function humanize (value) { | ||
if (value instanceof Uint8Array) { | ||
value = Buffer.from(value); | ||
} | ||
if (value instanceof Buffer) { | ||
@@ -55,0 +58,0 @@ value = keyToString(value); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
72910
639