@stardazed/adler32
Advanced tools
Comparing version 0.1.0 to 1.0.0
{ | ||
"name": "@stardazed/adler32", | ||
"description": "Stardazed - adler32 algorithm", | ||
"version": "0.1.0", | ||
"description": "Compute the Adler-32 checksum of a buffer", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -11,12 +11,15 @@ "type": "git", | ||
"license": "Zlib", | ||
"browser": "dist/index.esm.js", | ||
"module": "dist/index.esm.js", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/sd-adler32.umd.js", | ||
"browser": "dist/sd-adler32.esm.js", | ||
"module": "dist/sd-adler32.esm.js", | ||
"types": "dist/sd-adler32.d.ts", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"devDependencies": { | ||
"rollup": "^0.59.4", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-terser": "^1.0.1", | ||
"rollup-plugin-typescript2": "^0.14.0", | ||
"typescript": "^2.9.1" | ||
"rollup": "0.60.7", | ||
"rollup-plugin-typescript2": "^0.15.1", | ||
"typescript": "^2.9.2" | ||
} | ||
} |
@@ -1,39 +0,20 @@ | ||
sd-adler32 | ||
========== | ||
Compute the Adler-32 checksum of a data stream. | ||
@stardazed/adler32 | ||
================== | ||
Compute the Adler-32 checksum of a buffer. | ||
Installation | ||
------------ | ||
**⚠️ Important**: This package, like everything in the @stardazed org, | ||
is distributed as an ES2015 module and is intended for use in browsers, | ||
not in NodeJS per se. Browser-specific types may be used. | ||
``` | ||
npm install @stardazed/adler32 | ||
pnpm install @stardazed/adler32 | ||
yarn add @stardazed/adler32 | ||
``` | ||
`yarn add @stardazed/adler32` | ||
or | ||
`npm install --save @stardazed/adler32` | ||
Usage | ||
----- | ||
```ts | ||
/** | ||
* Compute the Adler-32 checksum of a source. | ||
* This method will do its best to get a correct stream of unsigned bytes out | ||
* of the specified input, but take care when passing in basic arrays. | ||
* You can use `adler32Bytes` for the "I know what I'm doing" version. | ||
* @param data Source data, a string, array, TypedArray or ArrayBuffer | ||
* @param adler Optional seed for the checksum | ||
*/ | ||
function adler32(data: string | number[] | TypedArray | DataView | ArrayBuffer, seed?: number): number; | ||
```js | ||
import { adler32 } from "@stardazed/adler32"; | ||
/** | ||
* Compute the Adler-32 checksum of a sequence of unsigned bytes. | ||
* Make very sure that the individual elements in buf are all | ||
* in the UNSIGNED byte range (i.e. 0..255) otherwise the | ||
* result will be indeterminate. | ||
* @param buf Source data, an array-like of unsigned bytes | ||
* @param adler Optional seed for the checksum | ||
*/ | ||
function adler32Bytes(buf: ArrayLike<number>, adler?: number): number; | ||
// takes an ArrayBuffer, TypedArray or DataView, returns an unsigned 32-bit int | ||
const checksum = adler32(new Uint8Array([1, 2, 3, 4])); | ||
``` | ||
@@ -40,0 +21,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9303
3
5
244
1
32
1