
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@types/bit-twiddle
Advanced tools
TypeScript definitions for bit-twiddle
npm install --save @types/bit-twiddle
This package contains type definitions for bit-twiddle (https://github.com/mikolalysenko/bit-twiddle).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bit-twiddle.
export const INT_BITS: number;
export const INT_MAX: number;
export const INT_MIN: number;
/**
* Computes the sign of the integer.
*/
export function sign(value: number): number;
/**
* Returns the absolute value of the integer.
*/
export function abs(value: number): number;
/**
* Computes the minimum of integers x and y.
*/
export function min(x: number, y: number): number;
/**
* Computes the maximum of integers x and y.
*/
export function max(x: number, y: number): number;
/**
* Returns true if value is a power of 2, otherwise false.
*/
export function isPow2(value: number): boolean;
/**
* Returns an integer approximation of the log-base 2 of value.
*/
export function log2(value: number): number;
/**
* Returns an integer approximation of the log-base 10 of value.
*/
export function log10(value: number): number;
/**
* Counts the number of bits set in value.
*/
export function popCount(value: number): number;
/**
* Counts the number of trailing zeros.
*/
export function countTrailingZeros(value: number): number;
/**
* Rounds value up to the next power of 2.
*/
export function nextPow2(value: number): number;
/**
* Rounds value down to the previous power of 2.
*/
export function prevPow2(value: number): number;
/**
* Computes the parity of the bits in value.
*/
export function parity(value: number): number;
/**
* Reverses the bits of value.
*/
export function reverse(value: number): number;
/**
* Interleaves a pair of 16 bit integers. Useful for fast quadtree style indexing.
* @see http://en.wikipedia.org/wiki/Z-order_curve
*/
export function interleave2(x: number, y: number): number;
/**
* Deinterleaves the bits of value, returns the nth part.
* If both x and y are 16 bit.
*/
export function deinterleave2(x: number, y: number): number;
/**
* Interleaves a triple of 10 bit integers. Useful for fast octree indexing.
*/
export function interleave3(x: number, y: number, z: number): number;
/**
* Same deal as deinterleave2, only for triples instead of pairs.
*/
export function deinterleave3(x: number, y: number): number;
/**
* Returns next combination ordered colexicographically.
*/
export function nextCombination(x: number): number;
These definitions were written by .
FAQs
TypeScript definitions for bit-twiddle
The npm package @types/bit-twiddle receives a total of 5,552 weekly downloads. As such, @types/bit-twiddle popularity was classified as popular.
We found that @types/bit-twiddle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.