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

@hookun/bitbybit

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hookun/bitbybit - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

8

lib/Wrapper.d.ts

@@ -7,7 +7,9 @@ export declare class Wrapper {

get buffer(): ArrayBuffer;
protected get byteLength(): number;
protected get byte(): number;
protected get bitOffsetFromStart(): number;
get byteLength(): number;
get bitLength(): number;
get byte(): number;
get bitOffsetFromStart(): number;
get done(): boolean;
residualBitLength(): number;
protected step(bitLength: number): boolean;
}

@@ -16,2 +16,5 @@ "use strict";

}
get bitLength() {
return this.byteLength * constants_1.WordSize;
}
get byte() {

@@ -26,6 +29,13 @@ return this.view.getUint8(this.byteOffset);

}
residualBitLength() {
return this.bitLength - this.bitOffsetFromStart;
}
step(bitLength) {
const bitOffset = this.bitOffset + bitLength;
this.bitOffset = bitOffset % constants_1.WordSize;
this.byteOffset += Math.floor(bitOffset / constants_1.WordSize);
this.bitOffset = bitOffset % constants_1.WordSize;
const { byteLength, byteOffset } = this;
if ((byteLength === byteOffset && 0 < this.bitOffset) || byteLength < byteOffset) {
throw new RangeError('Cannot step out of buffer');
}
return constants_1.WordSize <= bitOffset;

@@ -32,0 +42,0 @@ }

@@ -11,3 +11,3 @@ {

},
"version": "0.0.12",
"version": "0.0.13",
"license": "Apache-2.0",

@@ -14,0 +14,0 @@ "author": {

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