{"_id":"@aws/aws-wasm-checksums","name":"@aws/aws-wasm-checksums","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aws/aws-wasm-checksums","version":"0.1.0","description":"WASM implementations of checksums used by the AWS SDKs","author":{"name":"landonxjames"},"license":"Apache-2.0","type":"module","repository":{"type":"git","url":"git+https://github.com/awslabs/aws-wasm-checksums.git"},"exports":["./dist/index.js"],"scripts":{"test":"vitest --run","build-js-bindings":"cargo component build --release && npx jco transpile ./target/wasm32-wasip1/release/aws_wasm_checksums.wasm -o ./js-bindings/ --no-namespaced-exports","copy-js-bindings":"cp -r js-bindings dist/","build":"npm run build-js-bindings && npx tsc && npm run copy-js-bindings","test:browser":"vitest"},"devDependencies":{"@bytecodealliance/jco":"^1.9.1","@types/node":"^22.13.4","@vitest/browser":"^3.0.6","playwright":"^1.50.1","typescript":"^5.7.3","vitest":"^3.0.5"},"dependencies":{"@bytecodealliance/preview2-shim":"^0.17.1"},"_id":"@aws/aws-wasm-checksums@0.1.0","gitHead":"b6f859bb3f035bf5e79d7bdbe95c20ee556d65b1","bugs":{"url":"https://github.com/awslabs/aws-wasm-checksums/issues"},"homepage":"https://github.com/awslabs/aws-wasm-checksums#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tsOCzBseLgRlbW6AGyNG5THoRZGbsrIcDG77OamtzgJu28Q1apN05KlAPmisUZRfqOhhII5LFNsH0taNWLr8Dg==","shasum":"eda215209db5d8f432bf70e11d423f10b608431f","tarball":"https://registry.npmjs.org/@aws/aws-wasm-checksums/-/aws-wasm-checksums-0.1.0.tgz","fileCount":25,"unpackedSize":232055,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws%2faws-wasm-checksums@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCKFrhoYD/l4O3Yv/j7RiHXLQBr8mUL4FHZZ9plocpdMQIgIueuzbquLytuhpStkQ5o6VfDkO318CFCV57LYb5cJ7k="}]},"_npmUser":{"name":"aws-sdk-rust-ci","email":"aws-sdk-rust-primary@amazon.com"},"directories":{},"maintainers":[{"name":"aws-sdk-rust-ci","email":"aws-sdk-rust-primary@amazon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aws-wasm-checksums_0.1.0_1744397014529_0.5526436583586434"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-11T18:43:34.463Z","0.1.0":"2025-04-11T18:43:34.710Z","modified":"2025-04-11T18:43:35.251Z"},"maintainers":[{"name":"aws-sdk-rust-ci","email":"aws-sdk-rust-primary@amazon.com"}],"description":"WASM implementations of checksums used by the AWS SDKs","homepage":"https://github.com/awslabs/aws-wasm-checksums#readme","repository":{"type":"git","url":"git+https://github.com/awslabs/aws-wasm-checksums.git"},"author":{"name":"landonxjames"},"bugs":{"url":"https://github.com/awslabs/aws-wasm-checksums/issues"},"license":"Apache-2.0","readme":"## AWS WASM Checksums\n\nWASM implementations of the checksums supported by the [Smithy httpChecksum trait](https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait). The WASM implementation are based on the [WASM component model](https://component-model.bytecodealliance.org/).\n\n## Using this package\n\nThis package supports 5 checksum algorithms: `CRC32`, `CRC32C`, `CRC64NVME`, `SHA1`, and `SHA256`.\n\nAssociated with each of these algorithms are two functions, one for hashing to bytes and another for hashing and encoding as a `baase64` string:\n\n```ts\nfunction crc64NvmeHash(input: Uint8Array): Uint8Array;\nfunction crc64NvmeHashAndEncode(input: Uint8Array): string;\n```\n\nEach algorithm also has an associated accumulating `Hasher` class, useful for usecases where the full set of bytes to be hashed might not be known up front. The `Hasher` provides functions `finalize` and `finalizeAndEncode` which return bytes and a `base64` encoded string respectively.\n\n```ts\nlet hasher = new crc64NvmeHasher.Hasher();\nhasher.update(stringToUint8Array(\"Hello,\"));\nhasher.update(stringToUint8Array(\" World!\"));\nlet hashOut = hasher.finalize();\n```\n\n## Working with this Repo\n\nTo work on this repo you will need [Rust](https://www.rust-lang.org/tools/install), [Node](https://nodejs.org/en/download), and [cargo-component](https://crates.io/crates/cargo-component) installed.\n\nTo build the project run:\n\n```sh\nnpm install\ncargo install cargo-component\nnpx vitest init browser\nnpm run build\n```\n\nTo run tests against the javascript bindings run:\n\n```sh\nnpm run test\n```\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n","readmeFilename":"README.md","_rev":"1-d81aaa28af753574fa705f1fae204a0e"}