
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@consento/bigint-codec
Advanced tools
@consento/bigint-codec
is a codecs compatible encode and decoder for BigInt numbers.
Turns
bigint
numbers toBytes
andBytes
tobigint
numbers.
const {
bigUintLE,
bigUintBE,
bigIntLE,
bigIntBE,
bigIntQuick
} = require('@consento/bigint-codec')
bigUintLE.decode(
bigUintLE.encode(256n)
)
// If you would like to know how many bytes are encoded, perhaps the iterator might be more useful.
for (const byte of bigUintLE.encodeBytes(256n)) {
// If you need only to access the bytes and don't want to allocate a full ByteArray
}
const n256 = bigUintLE.decodeBytes([0, 2])
The byte formats are generally compatible with the rust library num-bigint.
biguint-le
- only for n >= 0; from lowest to highest bytes; fastest! It allows quick access and quick storage.biguint-be
- only for n >= 0; from highest to lowest bytes; encoding slower than le
, since we need to know first how many bytes are necessary.bigint-le
- from lowest to highest bytes; will store the sign in the first byte; negative numbers will be stored inversely (255-0 instead of 0-255)bigint-be
- from highest to lowest bytes; will store the sign in the last byte; slowest variant as it is very complex to map to javascriptAdditionally we support a custom codec called bigint-quick
. It is not compatible to other implementations but it is the fastest signed bigint
implementation we could find!
It will store the signature in the lowest bit of the first number and the absolute value from lowest to highest bytes - only slightly slower
than big-uint-le
. If its okay to not be compatible to other libraries, this should be your first choice, else big-int-le
is a fine choice.
Feel free to use the require('@consento/bigint-codec/biguint-le')
access notation for smaller bundle sizes.
FAQs
codecs compatible de-/encoder for bigints.
We found that @consento/bigint-codec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.