Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stardazed/adler32

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stardazed/adler32 - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

dist/sd-adler32.d.ts

23

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc