Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/@aws-crypto/sha1-browser/src/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
import { Sha1 as Ie11Sha1 } from "./ie11Sha1"; import { Sha1 as WebCryptoSha1 } from "./webCryptoSha1"; import { Checksum, SourceData } from "@aws-sdk/types"; import { supportsWebCrypto } from "@aws-crypto/supports-web-crypto"; import { isMsWindow } from "@aws-crypto/ie11-detection"; import { locateWindow } from "@aws-sdk/util-locate-window"; import { convertToBuffer } from "@aws-crypto/util"; export class Sha1 implements Checksum { private hash: Checksum; constructor(secret?: SourceData) { if (supportsWebCrypto(locateWindow())) { this.hash = new WebCryptoSha1(secret); } else if (isMsWindow(locateWindow())) { this.hash = new Ie11Sha1(secret); } else { throw new Error("SHA1 not supported"); } } update(data: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void { this.hash.update(convertToBuffer(data)); } digest(): Promise<Uint8Array> { return this.hash.digest(); } reset(): void { this.hash.reset(); } }