Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 14, 2024 via pnpm

long 3.2.0

A Long class for representing a 64-bit two's-complement integer value.
Package summary
Share
0
issues
1
license
1
Apache-2.0
Package created
12 Mar 2013
Version published
22 Jul 2016
Maintainers
1
Total deps
1
Direct deps
0
License
Apache-2.0

Issues

0
This package has no issues

Licenses

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
long@3.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of long 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does long do?

Long.js is a JavaScript library developed for representing a 64-bit two's-complement integer value. Based on the Closure Library, it aims to reliably work with and perform bitwise operations on the full 64 bits. This functionality is necessary because JavaScript can only handle integers within the safe range of 2<sup>53</sup>-1. Beyond this limit, JavaScript is unable to accurately represent integer values, which can create inaccuracies in mathematical calculations. Long.js solves this issue, offering extended support for unsigned 64-bit integers.

How do you use long?

Using long.js in your project involves a simple installation via npm, and its implementation is straightforward. To represent a 64-bit integer, you can instantiate a new Long object. Here's a quick example:

// Install via npm
$> npm install long

// In your JavaScript file
import Long from "long";

var value = new Long(0xFFFFFFFF, 0x7FFFFFFF);
console.log(value.toString());

In this example, we've created a new Long object with a 64-bit integer value and logged its string representation into the console. Note that blending ECMAScript modules (ESM) and CommonJS is not recommended, as it can yield different classes with the same functionality, even though they are fundamentally different module systems.

Where are the long docs?

The complete documentation of Long.js, including its constructor, fields, constants, utility functions, and methods, can be found in the readme file of its GitHub repository, here. It provides a comprehensive guide to getting started with the library - from installation and basic usage, to advanced functions, such as bitwise operations and string representation of 64-bit integers.