![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@4bitlabs/dct
Advanced tools
@4bitlabs/dct
JavaScript/TypeScript implementations of the DCT, with support for TypedArrays
.
import { dct, idct } from '@4bitlabs/dct';
const signal = Uint8ClampedArray.of(/* data */);
// Calculate DCT-II from signal
const coefficients = new Float64Array(signal.length);
dct(signal, coefficients);
// Reconstruct signal from coefficients with DCT-III
const reconstruction = new Uint8ClampedArray(coefficients.length);
idct(coefficients, reconstruction);
The dct()
and idct()
will produce an output of the same length
as the signal length
. This can be convenient, however
the implementations make no optimizations for the number of elements in the vector provided. If the
number of elements is known in advance, then you can use createDctOfN(n)
. For example, to create a 16-element DCT:
import { createDctOfN } from '@4bitlabs';
const dct16 = createDctOfN(16);
// DCT-II
const coefficients = new Float64Array(16);
dct16.transform(data, coefficients);
// DCT-III
const reconstruction = new Uint8ClampedArray(16);
dct16.inverse(coefficients, reconstruction);
An faster, optimized version of an 8-element DCT is available and implements the same interface:
import { dct, idct } from '@4bitlabs/dct/fast-dtc-8';
const signal = Uint8ClampedArray.of(0, 0, 0, 0, 0, 0, 0, 0);
// DCT-II
const coefficients = new Float64Array(8);
dct(signal, coefficients);
// DCT-III
const reconstruction = new Uint8ClampedArray(8);
idct(coefficients, reconstruction);
FAQs
Discrete cosine transform algorithms in js and ts
The npm package @4bitlabs/dct receives a total of 0 weekly downloads. As such, @4bitlabs/dct popularity was classified as not popular.
We found that @4bitlabs/dct demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.