@hookun/bitbybit
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,1 +0,1 @@ | ||
export declare const toString: (buffer: ArrayBuffer, bytesPerLine?: number, delimiter?: string) => string; | ||
export declare const toString: (buffer: ArrayBuffer, bitsPerLine?: number, delimiter?: string) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toString = (buffer, bytesPerLine = 4, delimiter = ' ') => { | ||
exports.toString = (buffer, bitsPerLine = 32, delimiter = '') => { | ||
const lines = []; | ||
@@ -9,6 +9,8 @@ let line = []; | ||
for (let byteOffset = 0; byteOffset < byteLength; byteOffset++) { | ||
const length = line.push(view.getUint8(byteOffset).toString(2).padStart(8, '0')); | ||
if (length === bytesPerLine) { | ||
lines.push(line.join(delimiter)); | ||
line = []; | ||
for (const bit of view.getUint8(byteOffset).toString(2).padStart(8, '0')) { | ||
const length = line.push(bit); | ||
if (length === bitsPerLine) { | ||
lines.push(line.join(delimiter)); | ||
line = []; | ||
} | ||
} | ||
@@ -15,0 +17,0 @@ } |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "Apache-2.0", | ||
@@ -36,8 +36,8 @@ "author": { | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^2.30.0", | ||
"@typescript-eslint/parser": "^2.30.0", | ||
"@typescript-eslint/eslint-plugin": "^2.31.0", | ||
"@typescript-eslint/parser": "^2.31.0", | ||
"ava": "^3.8.1", | ||
"eslint": "^6.8.0", | ||
"npm-run-all": "^4.1.5", | ||
"ts-node": "^8.9.1", | ||
"ts-node": "^8.10.1", | ||
"typedoc": "^0.17.6", | ||
@@ -44,0 +44,0 @@ "typedoc-plugin-markdown": "^2.2.17", |
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
22174
210