Socket
Socket
Sign inDemoInstall

@aws-sdk/hash-node

Package Overview
Dependencies
4
Maintainers
5
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.226.0 to 3.254.0

12

dist-cjs/index.js

@@ -5,2 +5,3 @@ "use strict";

const util_buffer_from_1 = require("@aws-sdk/util-buffer-from");
const util_utf8_1 = require("@aws-sdk/util-utf8");
const buffer_1 = require("buffer");

@@ -10,6 +11,8 @@ const crypto_1 = require("crypto");

constructor(algorithmIdentifier, secret) {
this.hash = secret ? (0, crypto_1.createHmac)(algorithmIdentifier, castSourceData(secret)) : (0, crypto_1.createHash)(algorithmIdentifier);
this.algorithmIdentifier = algorithmIdentifier;
this.secret = secret;
this.reset();
}
update(toHash, encoding) {
this.hash.update(castSourceData(toHash, encoding));
this.hash.update((0, util_utf8_1.toUint8Array)(castSourceData(toHash, encoding)));
}

@@ -19,2 +22,7 @@ digest() {

}
reset() {
this.hash = this.secret
? (0, crypto_1.createHmac)(this.algorithmIdentifier, castSourceData(this.secret))
: (0, crypto_1.createHash)(this.algorithmIdentifier);
}
}

@@ -21,0 +29,0 @@ exports.Hash = Hash;

import { fromArrayBuffer, fromString } from "@aws-sdk/util-buffer-from";
import { toUint8Array } from "@aws-sdk/util-utf8";
import { Buffer } from "buffer";

@@ -6,6 +7,8 @@ import { createHash, createHmac } from "crypto";

constructor(algorithmIdentifier, secret) {
this.hash = secret ? createHmac(algorithmIdentifier, castSourceData(secret)) : createHash(algorithmIdentifier);
this.algorithmIdentifier = algorithmIdentifier;
this.secret = secret;
this.reset();
}
update(toHash, encoding) {
this.hash.update(castSourceData(toHash, encoding));
this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
}

@@ -15,2 +18,7 @@ digest() {

}
reset() {
this.hash = this.secret
? createHmac(this.algorithmIdentifier, castSourceData(this.secret))
: createHash(this.algorithmIdentifier);
}
}

@@ -17,0 +25,0 @@ function castSourceData(toCast, encoding) {

9

dist-types/index.d.ts

@@ -1,7 +0,10 @@

import { Hash as IHash, SourceData } from "@aws-sdk/types";
export declare class Hash implements IHash {
private readonly hash;
import { Checksum, SourceData } from "@aws-sdk/types";
export declare class Hash implements Checksum {
private readonly algorithmIdentifier;
private readonly secret?;
private hash;
constructor(algorithmIdentifier: string, secret?: SourceData);
update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void;
digest(): Promise<Uint8Array>;
reset(): void;
}

@@ -1,7 +0,10 @@

import { Hash as IHash, SourceData } from "@aws-sdk/types";
export declare class Hash implements IHash {
private readonly hash;
import { Checksum, SourceData } from "@aws-sdk/types";
export declare class Hash implements Checksum {
private readonly algorithmIdentifier;
private readonly secret?;
private hash;
constructor(algorithmIdentifier: string, secret?: SourceData);
update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void;
digest(): Promise<Uint8Array>;
reset(): void;
}
{
"name": "@aws-sdk/hash-node",
"version": "3.226.0",
"version": "3.254.0",
"scripts": {

@@ -33,4 +33,5 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

"dependencies": {
"@aws-sdk/types": "3.226.0",
"@aws-sdk/types": "3.254.0",
"@aws-sdk/util-buffer-from": "3.208.0",
"@aws-sdk/util-utf8": "3.254.0",
"tslib": "^2.3.1"

@@ -37,0 +38,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc