@mavogel/awscdk-rootmail 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +8 -8
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js +464 -40
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/xxh/index.js +914 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.browser.js +2 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512.js +71 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512Js.js +276 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512WebCrypto.js +76 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/U64.js +190 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/Xxh3.js +274 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_128/Xxh3_128.js +179 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_64/Xxh3_64.js +117 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash64/Xxh64.js +150 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512Js.d.ts +29 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512WebCrypto.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/U64.d.ts +110 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/Xxh3.d.ts +139 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +37 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash64/Xxh64.d.ts +41 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512Js.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512WebCrypto.d.ts +14 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/U64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/Xxh3.d.ts +65 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +10 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash64/Xxh64.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/package.json +14 -4
- package/node_modules/@aws-sdk/checksums/xxh.d.ts +5 -0
- package/node_modules/@aws-sdk/checksums/xxh.js +5 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +51 -14
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/models/enums.js +1 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/schemas/schemas_0.js +46 -13
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/DeleteAccountPolicyCommand.d.ts +22 -5
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/DescribeAccountPoliciesCommand.d.ts +2 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/DescribeLogGroupsCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/PutAccountPolicyCommand.d.ts +18 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/TagLogGroupCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/TagResourceCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/commands/TestMetricFilterCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/models/models_0.d.ts +124 -58
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/models/models_1.d.ts +58 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/schemas/schemas_0.d.ts +3 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/commands/DeleteAccountPolicyCommand.d.ts +4 -3
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/commands/TagLogGroupCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/commands/TagResourceCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/commands/TestMetricFilterCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/models/models_0.d.ts +21 -12
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/models/models_1.d.ts +12 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/schemas/schemas_0.d.ts +3 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +5 -5
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +5 -5
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-s3/package.json +9 -9
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +5 -5
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +5 -5
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +1 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +1 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +3 -7
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
- package/node_modules/@aws-sdk/core/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +8 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +5 -59
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenWithIAMCommand.d.ts +5 -33
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +16 -9
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +8 -39
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/models_0.d.ts +36 -48
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -16
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +36 -17
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +42 -24
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
- package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js +10 -4
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +22 -9
- package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +14 -8
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
- package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/mailparser/CHANGELOG.md +26 -0
- package/node_modules/mailparser/README.md +21 -1
- package/node_modules/mailparser/dist/cjs/index.d.ts +3 -1
- package/node_modules/mailparser/dist/cjs/index.js +4 -2
- package/node_modules/mailparser/dist/cjs/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/cjs/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/cjs/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/cjs/otp-token.js +186 -0
- package/node_modules/mailparser/dist/cjs/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/cjs/types.d.ts +21 -0
- package/node_modules/mailparser/dist/esm/index.d.ts +3 -1
- package/node_modules/mailparser/dist/esm/index.js +3 -2
- package/node_modules/mailparser/dist/esm/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/esm/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/esm/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/esm/otp-token.js +180 -0
- package/node_modules/mailparser/dist/esm/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/esm/types.d.ts +21 -0
- package/node_modules/mailparser/package.json +3 -3
- package/node_modules/nodemailer/CHANGELOG.md +19 -0
- package/node_modules/nodemailer/dist/cjs/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/cjs/errors.js +3 -1
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/esm/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/esm/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/esm/errors.js +2 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/well-known/services.json +8 -0
- package/node_modules/nodemailer/package.json +5 -5
- package/package.json +7 -7
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
- /package/node_modules/@smithy/core/dist-types/submodules/{protocols → serde}/writeKey.d.ts +0 -0
- /package/node_modules/@smithy/core/dist-types/ts3.4/submodules/{protocols → serde}/writeKey.d.ts +0 -0
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
const l16 = 0b1_0000_0000_0000_0000;
|
|
2
|
+
const m8 = 0b1111_1111;
|
|
3
|
+
const m16 = 0b1111_1111_1111_1111;
|
|
4
|
+
const m32 = 0b11111111_11111111_11111111_11111111;
|
|
5
|
+
class U64 extends Uint32Array {
|
|
6
|
+
constructor(buffer) {
|
|
7
|
+
super(buffer);
|
|
8
|
+
}
|
|
9
|
+
static create(size) {
|
|
10
|
+
return new U64(new ArrayBuffer(size * 2 * 4));
|
|
11
|
+
}
|
|
12
|
+
write(i, v0, v1) {
|
|
13
|
+
i *= 2;
|
|
14
|
+
this[i] = v0;
|
|
15
|
+
this[i + 1] = v1;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
copy(source, target) {
|
|
19
|
+
source *= 2;
|
|
20
|
+
target *= 2;
|
|
21
|
+
this[target] = this[source];
|
|
22
|
+
this[target + 1] = this[source + 1];
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
add(i, v0, v1) {
|
|
26
|
+
i *= 2;
|
|
27
|
+
const j = i + 1;
|
|
28
|
+
const j0 = this[j];
|
|
29
|
+
const j1 = (j0 + v1) >>> 0;
|
|
30
|
+
this[i] = (this[i] + v0 + (j1 < j0 ? 1 : 0)) >>> 0;
|
|
31
|
+
this[j] = j1;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
multiply(i, v0, v1) {
|
|
35
|
+
i *= 2;
|
|
36
|
+
const i0 = this[i];
|
|
37
|
+
const i1 = this[i + 1];
|
|
38
|
+
const a0 = i1 & m16;
|
|
39
|
+
const a1 = i1 >>> 16;
|
|
40
|
+
const a2 = i0 & m16;
|
|
41
|
+
const a3 = i0 >>> 16;
|
|
42
|
+
const b0 = v1 & m16;
|
|
43
|
+
const b1 = v1 >>> 16;
|
|
44
|
+
const b2 = v0 & m16;
|
|
45
|
+
const b3 = v0 >>> 16;
|
|
46
|
+
const c0 = a0 * b0;
|
|
47
|
+
const c1 = ((c0 / l16) | 0) + a1 * b0 + a0 * b1;
|
|
48
|
+
const c2 = ((c1 / l16) | 0) + a2 * b0 + a1 * b1 + a0 * b2;
|
|
49
|
+
const c3 = ((c2 / l16) | 0) + a3 * b0 + a2 * b1 + a1 * b2 + a0 * b3;
|
|
50
|
+
this[i] = (((c3 & m16) << 16) | (c2 & m16)) >>> 0;
|
|
51
|
+
this[i + 1] = (((c1 & m16) << 16) | (c0 & m16)) >>> 0;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
addProduct(i, a, b) {
|
|
55
|
+
i *= 2;
|
|
56
|
+
const a0 = b & m16;
|
|
57
|
+
const a1 = b >>> 16;
|
|
58
|
+
const b0 = a & m16;
|
|
59
|
+
const b1 = a >>> 16;
|
|
60
|
+
const c0 = a0 * b0;
|
|
61
|
+
const c1 = ((c0 / l16) | 0) + a1 * b0 + a0 * b1;
|
|
62
|
+
const c2 = ((c1 / l16) | 0) + a1 * b1;
|
|
63
|
+
const lo = (((c1 & m16) << 16) | (c0 & m16)) >>> 0;
|
|
64
|
+
const hi = c2 >>> 0;
|
|
65
|
+
const prev = this[i + 1];
|
|
66
|
+
const newLo = (prev + lo) >>> 0;
|
|
67
|
+
this[i] = (this[i] + hi + (newLo < prev ? 1 : 0)) >>> 0;
|
|
68
|
+
this[i + 1] = newLo;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
multiply128(i, j, t, u) {
|
|
72
|
+
i *= 2;
|
|
73
|
+
j *= 2;
|
|
74
|
+
t *= 2;
|
|
75
|
+
u *= 2;
|
|
76
|
+
const a0 = this[i + 1] & m16;
|
|
77
|
+
const a1 = this[i + 1] >>> 16;
|
|
78
|
+
const a2 = this[i] & m16;
|
|
79
|
+
const a3 = this[i] >>> 16;
|
|
80
|
+
const b0 = this[j + 1] & m16;
|
|
81
|
+
const b1 = this[j + 1] >>> 16;
|
|
82
|
+
const b2 = this[j] & m16;
|
|
83
|
+
const b3 = this[j] >>> 16;
|
|
84
|
+
const c0 = a0 * b0;
|
|
85
|
+
const c1 = ((c0 / l16) | 0) + a1 * b0 + a0 * b1;
|
|
86
|
+
const c2 = ((c1 / l16) | 0) + a2 * b0 + a1 * b1 + a0 * b2;
|
|
87
|
+
const c3 = ((c2 / l16) | 0) + a3 * b0 + a2 * b1 + a1 * b2 + a0 * b3;
|
|
88
|
+
const c4 = ((c3 / l16) | 0) + a3 * b1 + a2 * b2 + a1 * b3;
|
|
89
|
+
const c5 = ((c4 / l16) | 0) + a3 * b2 + a2 * b3;
|
|
90
|
+
const c6 = ((c5 / l16) | 0) + a3 * b3;
|
|
91
|
+
const c7 = (c6 / l16) | 0;
|
|
92
|
+
this[u] = (((c3 & m16) << 16) | (c2 & m16)) >>> 0;
|
|
93
|
+
this[u + 1] = (((c1 & m16) << 16) | (c0 & m16)) >>> 0;
|
|
94
|
+
this[t] = (((c7 & m16) << 16) | (c6 & m16)) >>> 0;
|
|
95
|
+
this[t + 1] = (((c5 & m16) << 16) | (c4 & m16)) >>> 0;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
subtract(i, v0, v1) {
|
|
99
|
+
i *= 2;
|
|
100
|
+
const i1 = this[i + 1];
|
|
101
|
+
this[i] = (this[i] - v0 - (i1 < v1 ? 1 : 0)) >>> 0;
|
|
102
|
+
this[i + 1] = (i1 - v1) >>> 0;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
left(i, places) {
|
|
106
|
+
i *= 2;
|
|
107
|
+
if (places <= 0) ;
|
|
108
|
+
else if (places < 32) {
|
|
109
|
+
const v0 = this[i];
|
|
110
|
+
this[i] = ((v0 << places) >>> 0) | (this[i + 1] >>> (32 - places));
|
|
111
|
+
this[i + 1] = (this[i + 1] << places) >>> 0;
|
|
112
|
+
}
|
|
113
|
+
else if (places === 32) {
|
|
114
|
+
this[i] = this[i + 1];
|
|
115
|
+
this[i + 1] = 0;
|
|
116
|
+
}
|
|
117
|
+
else if (places > 32) {
|
|
118
|
+
this[i] = (this[i + 1] << (places - 32)) >>> 0;
|
|
119
|
+
this[i + 1] = 0;
|
|
120
|
+
}
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
rotateLeft(i, places) {
|
|
124
|
+
i *= 2;
|
|
125
|
+
const i0 = this[i];
|
|
126
|
+
const i1 = this[i + 1];
|
|
127
|
+
if (places === 0 || places === 64) ;
|
|
128
|
+
else if (places < 32) {
|
|
129
|
+
this[i] = ((i0 << places) >>> 0) | (i1 >>> (32 - places));
|
|
130
|
+
this[i + 1] = ((i1 << places) >>> 0) | (i0 >>> (32 - places));
|
|
131
|
+
}
|
|
132
|
+
else if (places === 32) {
|
|
133
|
+
this[i] = i1;
|
|
134
|
+
this[i + 1] = i0;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
const p = places - 32;
|
|
138
|
+
this[i] = ((i1 << p) >>> 0) | (i0 >>> (32 - p));
|
|
139
|
+
this[i + 1] = ((i0 << p) >>> 0) | (i1 >>> (32 - p));
|
|
140
|
+
}
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
right(i, places) {
|
|
144
|
+
i *= 2;
|
|
145
|
+
if (places <= 0) ;
|
|
146
|
+
else if (places < 32) {
|
|
147
|
+
this[i + 1] = (this[i + 1] >>> places) | ((this[i] << (32 - places)) >>> 0);
|
|
148
|
+
this[i] = this[i] >>> places;
|
|
149
|
+
}
|
|
150
|
+
else if (places === 32) {
|
|
151
|
+
this[i + 1] = this[i];
|
|
152
|
+
this[i] = 0;
|
|
153
|
+
}
|
|
154
|
+
else if (places > 32) {
|
|
155
|
+
this[i + 1] = this[i] >>> (places - 32);
|
|
156
|
+
this[i] = 0;
|
|
157
|
+
}
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
xor(i, v0, v1) {
|
|
161
|
+
i *= 2;
|
|
162
|
+
this[i] ^= v0;
|
|
163
|
+
this[i + 1] ^= v1;
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
toBytes(i) {
|
|
167
|
+
i *= 2;
|
|
168
|
+
const i0 = this[i];
|
|
169
|
+
const i1 = this[i + 1];
|
|
170
|
+
return new Uint8Array([
|
|
171
|
+
i0 >>> 24,
|
|
172
|
+
(i0 >>> 16) & m8,
|
|
173
|
+
(i0 >>> 8) & m8,
|
|
174
|
+
i0 & m8,
|
|
175
|
+
i1 >>> 24,
|
|
176
|
+
(i1 >>> 16) & m8,
|
|
177
|
+
(i1 >>> 8) & m8,
|
|
178
|
+
i1 & m8,
|
|
179
|
+
]);
|
|
180
|
+
}
|
|
181
|
+
hi(i) {
|
|
182
|
+
return this[i * 2];
|
|
183
|
+
}
|
|
184
|
+
lo(i) {
|
|
185
|
+
return this[i * 2 + 1];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const P = U64.create(6)
|
|
190
|
+
.write(0, 0b10011110001101110111100110110001, 0b10000101111010111100101010000111)
|
|
191
|
+
.write(1, 0b11000010101100101010111000111101, 0b00100111110101001110101101001111)
|
|
192
|
+
.write(3, 0b00010110010101100110011110110001, 0b10011110001101110111100111111001)
|
|
193
|
+
.write(4, 0b10000101111010111100101001110111, 0b11000010101100101010111001100011)
|
|
194
|
+
.write(5, 0b00100111110101001110101100101111, 0b00010110010101100110011111000101);
|
|
195
|
+
P.copy(0, 2).add(2, P.hi(1), P.lo(1));
|
|
196
|
+
const P1 = 0;
|
|
197
|
+
const P2 = 1;
|
|
198
|
+
const P1_2 = 2;
|
|
199
|
+
const P3 = 3;
|
|
200
|
+
const P4 = 4;
|
|
201
|
+
const P5 = 5;
|
|
202
|
+
const SEED$1 = 0;
|
|
203
|
+
const ACC0 = 1;
|
|
204
|
+
const ACC1 = 2;
|
|
205
|
+
const ACC2 = 3;
|
|
206
|
+
const ACC3 = 4;
|
|
207
|
+
const T0$1 = 5;
|
|
208
|
+
const T1$1 = 6;
|
|
209
|
+
const T2$1 = 7;
|
|
210
|
+
class Xxh64 {
|
|
211
|
+
digestLength = 8;
|
|
212
|
+
byteCount = 0;
|
|
213
|
+
mem = U64.create(8);
|
|
214
|
+
stripeBuffer = new Uint8Array(32);
|
|
215
|
+
bufferIndex = 0;
|
|
216
|
+
constructor() {
|
|
217
|
+
this.mem.write(SEED$1, 0, 0);
|
|
218
|
+
this.reset();
|
|
219
|
+
}
|
|
220
|
+
update(chunk) {
|
|
221
|
+
this.byteCount += chunk.byteLength;
|
|
222
|
+
this._update(chunk);
|
|
223
|
+
}
|
|
224
|
+
_update(chunk) {
|
|
225
|
+
if (this.bufferIndex !== 0 && this.bufferIndex + chunk.byteLength >= 32) {
|
|
226
|
+
const bytesFilled = 32 - this.bufferIndex;
|
|
227
|
+
for (let i = 0; i < bytesFilled; ++i) {
|
|
228
|
+
this.stripeBuffer[this.bufferIndex++] = chunk[i];
|
|
229
|
+
}
|
|
230
|
+
this.processStripe(this.stripeBuffer);
|
|
231
|
+
this.bufferIndex = 0;
|
|
232
|
+
return this._update(chunk.subarray(bytesFilled));
|
|
233
|
+
}
|
|
234
|
+
if (chunk.byteLength < 32) {
|
|
235
|
+
for (let i = 0; i < chunk.byteLength; ++i) {
|
|
236
|
+
this.stripeBuffer[this.bufferIndex++] = chunk[i];
|
|
237
|
+
if (this.bufferIndex === this.stripeBuffer.byteLength) {
|
|
238
|
+
this.bufferIndex = 0;
|
|
239
|
+
this.processStripe(this.stripeBuffer);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
for (let i = 0; i < chunk.byteLength; i += 32) {
|
|
245
|
+
const chunkLen = Math.min(i + 32, chunk.byteLength) - i;
|
|
246
|
+
const subchunk = chunk.subarray(i, i + chunkLen);
|
|
247
|
+
if (chunkLen < 32) {
|
|
248
|
+
return this._update(subchunk);
|
|
249
|
+
}
|
|
250
|
+
this.processStripe(subchunk);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async digest() {
|
|
255
|
+
const { mem, byteCount } = this;
|
|
256
|
+
const m = T0$1;
|
|
257
|
+
if (byteCount < 32) {
|
|
258
|
+
mem.copy(SEED$1, m).add(m, P.hi(P5), P.lo(P5));
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
mem.copy(ACC0, T1$1).rotateLeft(T1$1, 1);
|
|
262
|
+
mem.write(m, mem.hi(T1$1), mem.lo(T1$1));
|
|
263
|
+
mem.copy(ACC1, T1$1).rotateLeft(T1$1, 7);
|
|
264
|
+
mem.add(m, mem.hi(T1$1), mem.lo(T1$1));
|
|
265
|
+
mem.copy(ACC2, T1$1).rotateLeft(T1$1, 12);
|
|
266
|
+
mem.add(m, mem.hi(T1$1), mem.lo(T1$1));
|
|
267
|
+
mem.copy(ACC3, T1$1).rotateLeft(T1$1, 18);
|
|
268
|
+
mem.add(m, mem.hi(T1$1), mem.lo(T1$1));
|
|
269
|
+
this.mergeAcc(m, ACC0);
|
|
270
|
+
this.mergeAcc(m, ACC1);
|
|
271
|
+
this.mergeAcc(m, ACC2);
|
|
272
|
+
this.mergeAcc(m, ACC3);
|
|
273
|
+
}
|
|
274
|
+
mem.add(m, Math.floor(byteCount / m32), byteCount & m32);
|
|
275
|
+
let rem = this.bufferIndex;
|
|
276
|
+
let ptr = 0;
|
|
277
|
+
const b = this.stripeBuffer;
|
|
278
|
+
while (rem >= 8) {
|
|
279
|
+
const v1 = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
280
|
+
const v0 = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
281
|
+
mem.write(T1$1, 0, 0);
|
|
282
|
+
this.roundAt(T1$1, v0, v1);
|
|
283
|
+
mem.xor(m, mem.hi(T1$1), mem.lo(T1$1)).rotateLeft(m, 27).multiply(m, P.hi(P1), P.lo(P1)).add(m, P.hi(P4), P.lo(P4));
|
|
284
|
+
rem -= 8;
|
|
285
|
+
}
|
|
286
|
+
while (rem >= 4) {
|
|
287
|
+
const lo = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
288
|
+
mem.write(T1$1, 0, lo).multiply(T1$1, P.hi(P1), P.lo(P1));
|
|
289
|
+
mem.xor(m, mem.hi(T1$1), mem.lo(T1$1)).rotateLeft(m, 23).multiply(m, P.hi(P2), P.lo(P2)).add(m, P.hi(P3), P.lo(P3));
|
|
290
|
+
rem -= 4;
|
|
291
|
+
}
|
|
292
|
+
while (rem >= 1) {
|
|
293
|
+
mem.write(T1$1, 0, b[ptr++]).multiply(T1$1, P.hi(P5), P.lo(P5));
|
|
294
|
+
mem.xor(m, mem.hi(T1$1), mem.lo(T1$1)).rotateLeft(m, 11).multiply(m, P.hi(P1), P.lo(P1));
|
|
295
|
+
rem -= 1;
|
|
296
|
+
}
|
|
297
|
+
this.avalanche(m);
|
|
298
|
+
return mem.toBytes(m);
|
|
299
|
+
}
|
|
300
|
+
reset() {
|
|
301
|
+
const { mem } = this;
|
|
302
|
+
this.byteCount = 0;
|
|
303
|
+
this.bufferIndex = 0;
|
|
304
|
+
mem.copy(SEED$1, ACC0).add(ACC0, P.hi(P1_2), P.lo(P1_2));
|
|
305
|
+
mem.copy(SEED$1, ACC1).add(ACC1, P.hi(P2), P.lo(P2));
|
|
306
|
+
mem.copy(SEED$1, ACC2);
|
|
307
|
+
mem.copy(SEED$1, ACC3).subtract(ACC3, P.hi(P1), P.lo(P1));
|
|
308
|
+
}
|
|
309
|
+
processStripe(stripe) {
|
|
310
|
+
for (let i = 0; i < 4; ++i) {
|
|
311
|
+
const ix = i * 8;
|
|
312
|
+
const v1 = stripe[ix] | (stripe[ix + 1] << 8) | (stripe[ix + 2] << 16) | ((stripe[ix + 3] << 24) >>> 0);
|
|
313
|
+
const v0 = stripe[ix + 4] | (stripe[ix + 5] << 8) | (stripe[ix + 6] << 16) | ((stripe[ix + 7] << 24) >>> 0);
|
|
314
|
+
this.roundAt(ACC0 + i, v0, v1);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
mergeAcc(m, acc) {
|
|
318
|
+
const { mem } = this;
|
|
319
|
+
mem.write(T1$1, 0, 0);
|
|
320
|
+
this.roundAt(T1$1, mem.hi(acc), mem.lo(acc));
|
|
321
|
+
mem.xor(m, mem.hi(T1$1), mem.lo(T1$1)).multiply(m, P.hi(P1), P.lo(P1)).add(m, P.hi(P4), P.lo(P4));
|
|
322
|
+
}
|
|
323
|
+
roundAt(i, v0, v1) {
|
|
324
|
+
const { mem } = this;
|
|
325
|
+
mem.write(T2$1, v0, v1).multiply(T2$1, P.hi(P2), P.lo(P2));
|
|
326
|
+
mem.add(i, mem.hi(T2$1), mem.lo(T2$1)).rotateLeft(i, 31).multiply(i, P.hi(P1), P.lo(P1));
|
|
327
|
+
}
|
|
328
|
+
avalanche(i) {
|
|
329
|
+
const { mem } = this;
|
|
330
|
+
mem.copy(i, T1$1).right(T1$1, 33);
|
|
331
|
+
mem.xor(i, mem.hi(T1$1), mem.lo(T1$1)).multiply(i, P.hi(P2), P.lo(P2));
|
|
332
|
+
mem.copy(i, T1$1).right(T1$1, 29);
|
|
333
|
+
mem.xor(i, mem.hi(T1$1), mem.lo(T1$1)).multiply(i, P.hi(P3), P.lo(P3));
|
|
334
|
+
mem.copy(i, T1$1).right(T1$1, 32);
|
|
335
|
+
mem.xor(i, mem.hi(T1$1), mem.lo(T1$1));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const PRIME32_1 = 0x9e3779b1;
|
|
340
|
+
const PRIME32_2 = 0x85ebca77;
|
|
341
|
+
const PRIME32_3 = 0xc2b2ae3d;
|
|
342
|
+
const PRIME64_1_0 = 0x9e3779b1;
|
|
343
|
+
const PRIME64_1_1 = 0x85ebca87;
|
|
344
|
+
const PRIME64_2_0 = 0xc2b2ae3d;
|
|
345
|
+
const PRIME64_2_1 = 0x27d4eb4f;
|
|
346
|
+
const PRIME64_3_0 = 0x165667b1;
|
|
347
|
+
const PRIME64_3_1 = 0x9e3779f9;
|
|
348
|
+
const PRIME64_4_0 = 0x85ebca77;
|
|
349
|
+
const PRIME64_4_1 = 0xc2b2ae63;
|
|
350
|
+
const PRIME64_5_0 = 0x27d4eb2f;
|
|
351
|
+
const PRIME64_5_1 = 0x165667c5;
|
|
352
|
+
const PRIME_MX1_0 = 0x16566791;
|
|
353
|
+
const PRIME_MX1_1 = 0x9e3779f9;
|
|
354
|
+
const PRIME_MX2_0 = 0x9fb21c65;
|
|
355
|
+
const PRIME_MX2_1 = 0x1e98df25;
|
|
356
|
+
const DEFAULT_SECRET = new Uint8Array([
|
|
357
|
+
0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c, 0xde, 0xd4, 0x6d,
|
|
358
|
+
0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, 0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0,
|
|
359
|
+
0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0,
|
|
360
|
+
0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c, 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b,
|
|
361
|
+
0x1b, 0x53, 0x2e, 0xa3, 0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac,
|
|
362
|
+
0xd8, 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d, 0x8a, 0x51,
|
|
363
|
+
0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, 0xea, 0xc5, 0xac, 0x83, 0x34,
|
|
364
|
+
0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49,
|
|
365
|
+
0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e, 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8,
|
|
366
|
+
0xd1, 0x7a, 0xd0, 0x31, 0xce, 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b,
|
|
367
|
+
0x40, 0x7e,
|
|
368
|
+
]);
|
|
369
|
+
const SEED = 0;
|
|
370
|
+
const ACC = 1;
|
|
371
|
+
const T0 = 9;
|
|
372
|
+
const T1 = 10;
|
|
373
|
+
const T2 = 11;
|
|
374
|
+
const T3 = 12;
|
|
375
|
+
const T4 = 13;
|
|
376
|
+
const T5 = 14;
|
|
377
|
+
const T6 = 15;
|
|
378
|
+
const SECRET_LENGTH = 192;
|
|
379
|
+
const STRIPES_PER_BLOCK = (SECRET_LENGTH - 64) / 8;
|
|
380
|
+
const BLOCK_SIZE = 64 * STRIPES_PER_BLOCK;
|
|
381
|
+
function readU32LE(b, offset) {
|
|
382
|
+
const o = offset;
|
|
383
|
+
return (b[o] | (b[o + 1] << 8) | (b[o + 2] << 16) | ((b[o + 3] << 24) >>> 0)) >>> 0;
|
|
384
|
+
}
|
|
385
|
+
function readU64LE(b, offset) {
|
|
386
|
+
const o = offset;
|
|
387
|
+
const r1 = (b[o] | (b[o + 1] << 8) | (b[o + 2] << 16) | ((b[o + 3] << 24) >>> 0)) >>> 0;
|
|
388
|
+
const r0 = (b[o + 4] | (b[o + 5] << 8) | (b[o + 6] << 16) | ((b[o + 7] << 24) >>> 0)) >>> 0;
|
|
389
|
+
return [r0, r1];
|
|
390
|
+
}
|
|
391
|
+
function bswap32(x) {
|
|
392
|
+
return (((x & 0xff) << 24) | (((x >>> 8) & 0xff) << 16) | (((x >>> 16) & 0xff) << 8) | ((x >>> 24) & 0xff)) >>> 0;
|
|
393
|
+
}
|
|
394
|
+
class Xxh3 {
|
|
395
|
+
mem;
|
|
396
|
+
seed0 = 0;
|
|
397
|
+
seed1 = 0;
|
|
398
|
+
secret = DEFAULT_SECRET;
|
|
399
|
+
dvBuffer = null;
|
|
400
|
+
dataView = null;
|
|
401
|
+
blockBuffer = new Uint8Array(BLOCK_SIZE);
|
|
402
|
+
bufferIndex = 0;
|
|
403
|
+
byteCount = 0;
|
|
404
|
+
prevTail = new Uint8Array(64);
|
|
405
|
+
hasPrevTail = false;
|
|
406
|
+
streaming = false;
|
|
407
|
+
constructor(slots, seed0 = 0, seed1 = 0) {
|
|
408
|
+
this.mem = U64.create(slots);
|
|
409
|
+
this.seed0 = seed0;
|
|
410
|
+
this.seed1 = seed1;
|
|
411
|
+
this.mem.write(SEED, seed0, seed1);
|
|
412
|
+
if (seed0 !== 0 || seed1 !== 0) {
|
|
413
|
+
this.secret = this.deriveSecret();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
update(chunk) {
|
|
417
|
+
if (chunk.byteLength === 0) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
this.byteCount += chunk.byteLength;
|
|
421
|
+
let offset = 0;
|
|
422
|
+
const space = BLOCK_SIZE - this.bufferIndex;
|
|
423
|
+
if (chunk.byteLength <= space) {
|
|
424
|
+
this.blockBuffer.set(chunk, this.bufferIndex);
|
|
425
|
+
this.bufferIndex += chunk.byteLength;
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (this.bufferIndex > 0) {
|
|
429
|
+
this.blockBuffer.set(chunk.subarray(0, space), this.bufferIndex);
|
|
430
|
+
this.processFullBlock(this.blockBuffer);
|
|
431
|
+
this.bufferIndex = 0;
|
|
432
|
+
offset = space;
|
|
433
|
+
}
|
|
434
|
+
while (offset + BLOCK_SIZE < chunk.byteLength) {
|
|
435
|
+
this.processFullBlock(chunk.subarray(offset, offset + BLOCK_SIZE));
|
|
436
|
+
offset += BLOCK_SIZE;
|
|
437
|
+
}
|
|
438
|
+
const remaining = chunk.byteLength - offset;
|
|
439
|
+
if (remaining > 0) {
|
|
440
|
+
this.blockBuffer.set(chunk.subarray(offset), 0);
|
|
441
|
+
this.bufferIndex = remaining;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
reset() {
|
|
445
|
+
this.byteCount = 0;
|
|
446
|
+
this.bufferIndex = 0;
|
|
447
|
+
this.streaming = false;
|
|
448
|
+
this.hasPrevTail = false;
|
|
449
|
+
this.dvBuffer = null;
|
|
450
|
+
this.dataView = null;
|
|
451
|
+
}
|
|
452
|
+
getBufferedInput() {
|
|
453
|
+
return this.blockBuffer.subarray(0, this.bufferIndex);
|
|
454
|
+
}
|
|
455
|
+
finalizeLargeAccumulators() {
|
|
456
|
+
if (!this.streaming) {
|
|
457
|
+
this.initAccumulators();
|
|
458
|
+
this.processLastBlock(this.blockBuffer, this.bufferIndex);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
this.processLastBlock(this.blockBuffer, this.bufferIndex);
|
|
462
|
+
}
|
|
463
|
+
initAccumulators() {
|
|
464
|
+
const { mem } = this;
|
|
465
|
+
mem.write(ACC + 0, 0, PRIME32_3);
|
|
466
|
+
mem.write(ACC + 1, PRIME64_1_0, PRIME64_1_1);
|
|
467
|
+
mem.write(ACC + 2, PRIME64_2_0, PRIME64_2_1);
|
|
468
|
+
mem.write(ACC + 3, PRIME64_3_0, PRIME64_3_1);
|
|
469
|
+
mem.write(ACC + 4, PRIME64_4_0, PRIME64_4_1);
|
|
470
|
+
mem.write(ACC + 5, 0, PRIME32_2);
|
|
471
|
+
mem.write(ACC + 6, PRIME64_5_0, PRIME64_5_1);
|
|
472
|
+
mem.write(ACC + 7, 0, PRIME32_1);
|
|
473
|
+
}
|
|
474
|
+
accumulateStripe(input, stripeOffset, secretOffset) {
|
|
475
|
+
const { mem } = this;
|
|
476
|
+
const secret = this.secret;
|
|
477
|
+
const idv = this.view(input);
|
|
478
|
+
const sdv = this.view(secret);
|
|
479
|
+
for (let i = 0; i < 8; i++) {
|
|
480
|
+
const off = i * 8;
|
|
481
|
+
const d1 = idv.getUint32(stripeOffset + off, true);
|
|
482
|
+
const d0 = idv.getUint32(stripeOffset + off + 4, true);
|
|
483
|
+
const s1 = sdv.getUint32(secretOffset + off, true);
|
|
484
|
+
const s0 = sdv.getUint32(secretOffset + off + 4, true);
|
|
485
|
+
const val0 = (d0 ^ s0) >>> 0;
|
|
486
|
+
const val1 = (d1 ^ s1) >>> 0;
|
|
487
|
+
mem.add(ACC + (i ^ 1), d0, d1);
|
|
488
|
+
mem.addProduct(ACC + i, val0, val1);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
roundScramble() {
|
|
492
|
+
const { mem } = this;
|
|
493
|
+
const secret = this.secret;
|
|
494
|
+
const view = this.view(secret);
|
|
495
|
+
for (let i = 0; i < 8; i++) {
|
|
496
|
+
const off = SECRET_LENGTH - 64 + i * 8;
|
|
497
|
+
const s1 = view.getUint32(off, true);
|
|
498
|
+
const s0 = view.getUint32(off + 4, true);
|
|
499
|
+
mem.copy(ACC + i, T1).right(T1, 47);
|
|
500
|
+
mem.xor(ACC + i, mem.hi(T1), mem.lo(T1));
|
|
501
|
+
mem.xor(ACC + i, s0, s1);
|
|
502
|
+
mem.multiply(ACC + i, 0, PRIME32_1);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
finalMerge(init0, init1, secretOffset) {
|
|
506
|
+
const { mem } = this;
|
|
507
|
+
const secret = this.secret;
|
|
508
|
+
mem.write(T0, init0, init1);
|
|
509
|
+
for (let i = 0; i < 4; i++) {
|
|
510
|
+
const [s00, s01] = readU64LE(secret, secretOffset + i * 16);
|
|
511
|
+
const [s10, s11] = readU64LE(secret, secretOffset + i * 16 + 8);
|
|
512
|
+
mem.copy(ACC + i * 2, T1).xor(T1, s00, s01);
|
|
513
|
+
mem.copy(ACC + i * 2 + 1, T2).xor(T2, s10, s11);
|
|
514
|
+
mem.multiply128(T1, T2, T4, T3);
|
|
515
|
+
mem.xor(T3, mem.hi(T4), mem.lo(T4));
|
|
516
|
+
mem.add(T0, mem.hi(T3), mem.lo(T3));
|
|
517
|
+
}
|
|
518
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
519
|
+
return mem.toBytes(T0);
|
|
520
|
+
}
|
|
521
|
+
mix(data, dataOffset, secretOffset) {
|
|
522
|
+
const { mem } = this;
|
|
523
|
+
const secret = this.secret;
|
|
524
|
+
const [d00, d01] = readU64LE(data, dataOffset);
|
|
525
|
+
const [d10, d11] = readU64LE(data, dataOffset + 8);
|
|
526
|
+
const [s00, s01] = readU64LE(secret, secretOffset);
|
|
527
|
+
const [s10, s11] = readU64LE(secret, secretOffset + 8);
|
|
528
|
+
mem.write(T5, s00, s01).add(T5, this.seed0, this.seed1);
|
|
529
|
+
mem.write(T6, s10, s11).subtract(T6, this.seed0, this.seed1);
|
|
530
|
+
mem.write(T5, (d00 ^ mem.hi(T5)) >>> 0, (d01 ^ mem.lo(T5)) >>> 0);
|
|
531
|
+
mem.write(T6, (d10 ^ mem.hi(T6)) >>> 0, (d11 ^ mem.lo(T6)) >>> 0);
|
|
532
|
+
mem.multiply128(T5, T6, T4, T3);
|
|
533
|
+
mem.xor(T3, mem.hi(T4), mem.lo(T4));
|
|
534
|
+
return T3;
|
|
535
|
+
}
|
|
536
|
+
avalanche(i, v0, v1) {
|
|
537
|
+
const { mem } = this;
|
|
538
|
+
mem.write(i, v0, v1);
|
|
539
|
+
mem.copy(i, T3).right(T3, 37);
|
|
540
|
+
mem.xor(i, mem.hi(T3), mem.lo(T3));
|
|
541
|
+
mem.multiply(i, PRIME_MX1_0, PRIME_MX1_1);
|
|
542
|
+
mem.copy(i, T3).right(T3, 32);
|
|
543
|
+
mem.xor(i, mem.hi(T3), mem.lo(T3));
|
|
544
|
+
}
|
|
545
|
+
avalanche64(i, v0, v1) {
|
|
546
|
+
const { mem } = this;
|
|
547
|
+
mem.write(i, v0, v1);
|
|
548
|
+
mem.copy(i, T3).right(T3, 33);
|
|
549
|
+
mem.xor(i, mem.hi(T3), mem.lo(T3));
|
|
550
|
+
mem.multiply(i, PRIME64_2_0, PRIME64_2_1);
|
|
551
|
+
mem.copy(i, T3).right(T3, 29);
|
|
552
|
+
mem.xor(i, mem.hi(T3), mem.lo(T3));
|
|
553
|
+
mem.multiply(i, PRIME64_3_0, PRIME64_3_1);
|
|
554
|
+
mem.copy(i, T3).right(T3, 32);
|
|
555
|
+
mem.xor(i, mem.hi(T3), mem.lo(T3));
|
|
556
|
+
}
|
|
557
|
+
deriveSecret() {
|
|
558
|
+
const { mem } = this;
|
|
559
|
+
const derived = new Uint8Array(DEFAULT_SECRET);
|
|
560
|
+
const dv = new DataView(derived.buffer);
|
|
561
|
+
for (let i = 0; i < 12; i++) {
|
|
562
|
+
const off = i * 16;
|
|
563
|
+
const v1 = dv.getUint32(off, true);
|
|
564
|
+
const v0 = dv.getUint32(off + 4, true);
|
|
565
|
+
mem.write(T0, v0, v1).add(T0, this.seed0, this.seed1);
|
|
566
|
+
dv.setUint32(off, mem.lo(T0), true);
|
|
567
|
+
dv.setUint32(off + 4, mem.hi(T0), true);
|
|
568
|
+
const w1 = dv.getUint32(off + 8, true);
|
|
569
|
+
const w0 = dv.getUint32(off + 12, true);
|
|
570
|
+
mem.write(T0, w0, w1).subtract(T0, this.seed0, this.seed1);
|
|
571
|
+
dv.setUint32(off + 8, mem.lo(T0), true);
|
|
572
|
+
dv.setUint32(off + 12, mem.hi(T0), true);
|
|
573
|
+
}
|
|
574
|
+
return derived;
|
|
575
|
+
}
|
|
576
|
+
view(b) {
|
|
577
|
+
if (b.buffer !== this.dvBuffer) {
|
|
578
|
+
this.dvBuffer = b.buffer;
|
|
579
|
+
this.dataView = new DataView(b.buffer, b.byteOffset, b.byteLength);
|
|
580
|
+
}
|
|
581
|
+
return this.dataView;
|
|
582
|
+
}
|
|
583
|
+
processFullBlock(block) {
|
|
584
|
+
if (!this.streaming) {
|
|
585
|
+
this.streaming = true;
|
|
586
|
+
this.initAccumulators();
|
|
587
|
+
}
|
|
588
|
+
for (let n = 0; n < STRIPES_PER_BLOCK; n++) {
|
|
589
|
+
this.accumulateStripe(block, n * 64, n * 8);
|
|
590
|
+
}
|
|
591
|
+
this.roundScramble();
|
|
592
|
+
this.prevTail.set(block.subarray(BLOCK_SIZE - 64, BLOCK_SIZE));
|
|
593
|
+
this.hasPrevTail = true;
|
|
594
|
+
}
|
|
595
|
+
processLastBlock(data, len) {
|
|
596
|
+
const nFullStripes = Math.floor((len - 1) / 64);
|
|
597
|
+
for (let n = 0; n < nFullStripes; ++n) {
|
|
598
|
+
this.accumulateStripe(data, n * 64, n * 8);
|
|
599
|
+
}
|
|
600
|
+
if (len < 64 && this.hasPrevTail) {
|
|
601
|
+
const window = new Uint8Array(64);
|
|
602
|
+
const fromPrev = 64 - len;
|
|
603
|
+
window.set(this.prevTail.subarray(64 - fromPrev), 0);
|
|
604
|
+
window.set(data.subarray(0, len), fromPrev);
|
|
605
|
+
this.accumulateStripe(window, 0, SECRET_LENGTH - 71);
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
this.accumulateStripe(data, len - 64, SECRET_LENGTH - 71);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
class Xxh3_64 extends Xxh3 {
|
|
614
|
+
digestLength = 8;
|
|
615
|
+
constructor() {
|
|
616
|
+
super(17, 0, 0);
|
|
617
|
+
}
|
|
618
|
+
async digest() {
|
|
619
|
+
const len = this.byteCount;
|
|
620
|
+
if (len <= 240) {
|
|
621
|
+
const input = this.getBufferedInput();
|
|
622
|
+
if (len <= 16) {
|
|
623
|
+
return this.digestSmall(input, len);
|
|
624
|
+
}
|
|
625
|
+
return this.digestMedium(input, len);
|
|
626
|
+
}
|
|
627
|
+
return this.digestLarge(len);
|
|
628
|
+
}
|
|
629
|
+
digestSmall(input, len) {
|
|
630
|
+
const { mem } = this;
|
|
631
|
+
const secret = this.secret;
|
|
632
|
+
if (len === 0) {
|
|
633
|
+
const [s00, s01] = readU64LE(secret, 56);
|
|
634
|
+
const [s10, s11] = readU64LE(secret, 64);
|
|
635
|
+
mem.write(T0, s00 ^ s10, (s01 ^ s11) >>> 0).xor(T0, this.seed0, this.seed1);
|
|
636
|
+
this.avalanche64(T0, mem.hi(T0), mem.lo(T0));
|
|
637
|
+
return mem.toBytes(T0);
|
|
638
|
+
}
|
|
639
|
+
if (len <= 3) {
|
|
640
|
+
const combined = (input[len - 1] | (len << 8) | (input[0] << 16) | ((input[len >> 1] << 24) >>> 0)) >>> 0;
|
|
641
|
+
const s0 = readU32LE(secret, 0);
|
|
642
|
+
const s1 = readU32LE(secret, 4);
|
|
643
|
+
mem
|
|
644
|
+
.write(T0, 0, (s0 ^ s1) >>> 0)
|
|
645
|
+
.add(T0, this.seed0, this.seed1)
|
|
646
|
+
.xor(T0, 0, combined);
|
|
647
|
+
this.avalanche64(T0, mem.hi(T0), mem.lo(T0));
|
|
648
|
+
return mem.toBytes(T0);
|
|
649
|
+
}
|
|
650
|
+
if (len <= 8) {
|
|
651
|
+
const inputFirst = readU32LE(input, 0);
|
|
652
|
+
const inputLast = readU32LE(input, len - 4);
|
|
653
|
+
const modSeed0 = (this.seed0 ^ bswap32(this.seed1)) >>> 0;
|
|
654
|
+
const [s00, s01] = readU64LE(secret, 8);
|
|
655
|
+
const [s10, s11] = readU64LE(secret, 16);
|
|
656
|
+
mem
|
|
657
|
+
.write(T0, (s00 ^ s10) >>> 0, (s01 ^ s11) >>> 0)
|
|
658
|
+
.subtract(T0, modSeed0, this.seed1)
|
|
659
|
+
.xor(T0, inputFirst, inputLast);
|
|
660
|
+
mem.copy(T0, T1).rotateLeft(T1, 49);
|
|
661
|
+
mem.copy(T0, T2).rotateLeft(T2, 24);
|
|
662
|
+
mem.xor(T0, mem.hi(T1), mem.lo(T1)).xor(T0, mem.hi(T2), mem.lo(T2));
|
|
663
|
+
mem.multiply(T0, PRIME_MX2_0, PRIME_MX2_1);
|
|
664
|
+
mem.copy(T0, T1).right(T1, 35).add(T1, 0, len);
|
|
665
|
+
mem.xor(T0, mem.hi(T1), mem.lo(T1));
|
|
666
|
+
mem.multiply(T0, PRIME_MX2_0, PRIME_MX2_1);
|
|
667
|
+
mem.copy(T0, T1).right(T1, 28);
|
|
668
|
+
mem.xor(T0, mem.hi(T1), mem.lo(T1));
|
|
669
|
+
return mem.toBytes(T0);
|
|
670
|
+
}
|
|
671
|
+
const [if0, if1] = readU64LE(input, 0);
|
|
672
|
+
const [il0, il1] = readU64LE(input, len - 8);
|
|
673
|
+
const [s00, s01] = readU64LE(secret, 24);
|
|
674
|
+
const [s10, s11] = readU64LE(secret, 32);
|
|
675
|
+
const [s20, s21] = readU64LE(secret, 40);
|
|
676
|
+
const [s30, s31] = readU64LE(secret, 48);
|
|
677
|
+
mem
|
|
678
|
+
.write(T0, (s00 ^ s10) >>> 0, (s01 ^ s11) >>> 0)
|
|
679
|
+
.add(T0, this.seed0, this.seed1)
|
|
680
|
+
.xor(T0, if0, if1);
|
|
681
|
+
mem
|
|
682
|
+
.write(T1, (s20 ^ s30) >>> 0, (s21 ^ s31) >>> 0)
|
|
683
|
+
.subtract(T1, this.seed0, this.seed1)
|
|
684
|
+
.xor(T1, il0, il1);
|
|
685
|
+
mem.multiply128(T0, T1, T3, T2);
|
|
686
|
+
mem.write(T4, 0, len);
|
|
687
|
+
mem.add(T4, bswap32(mem.lo(T0)), bswap32(mem.hi(T0))).add(T4, mem.hi(T1), mem.lo(T1));
|
|
688
|
+
mem.copy(T2, T0).xor(T0, mem.hi(T3), mem.lo(T3));
|
|
689
|
+
mem.add(T4, mem.hi(T0), mem.lo(T0));
|
|
690
|
+
this.avalanche(T0, mem.hi(T4), mem.lo(T4));
|
|
691
|
+
return mem.toBytes(T0);
|
|
692
|
+
}
|
|
693
|
+
digestMedium(input, len) {
|
|
694
|
+
const { mem } = this;
|
|
695
|
+
mem.write(T0, 0, len).multiply(T0, PRIME64_1_0, PRIME64_1_1);
|
|
696
|
+
if (len <= 128) {
|
|
697
|
+
const numRounds = ((len - 1) >> 5) + 1;
|
|
698
|
+
for (let i = numRounds - 1; i >= 0; i--) {
|
|
699
|
+
const ms1 = this.mix(input, i * 16, i * 32);
|
|
700
|
+
mem.add(T0, mem.hi(ms1), mem.lo(ms1));
|
|
701
|
+
const ms2 = this.mix(input, len - i * 16 - 16, i * 32 + 16);
|
|
702
|
+
mem.add(T0, mem.hi(ms2), mem.lo(ms2));
|
|
703
|
+
}
|
|
704
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
705
|
+
return mem.toBytes(T0);
|
|
706
|
+
}
|
|
707
|
+
for (let i = 0; i < 8; i++) {
|
|
708
|
+
const mix = this.mix(input, i * 16, i * 16);
|
|
709
|
+
mem.add(T0, mem.hi(mix), mem.lo(mix));
|
|
710
|
+
}
|
|
711
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
712
|
+
const numChunks = len >> 4;
|
|
713
|
+
for (let i = 8; i < numChunks; i++) {
|
|
714
|
+
const ms = this.mix(input, i * 16, (i - 8) * 16 + 3);
|
|
715
|
+
mem.add(T0, mem.hi(ms), mem.lo(ms));
|
|
716
|
+
}
|
|
717
|
+
const ms = this.mix(input, len - 16, 119);
|
|
718
|
+
mem.add(T0, mem.hi(ms), mem.lo(ms));
|
|
719
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
720
|
+
return mem.toBytes(T0);
|
|
721
|
+
}
|
|
722
|
+
digestLarge(len) {
|
|
723
|
+
const { mem } = this;
|
|
724
|
+
this.finalizeLargeAccumulators();
|
|
725
|
+
mem.write(T0, 0, len).multiply(T0, PRIME64_1_0, PRIME64_1_1);
|
|
726
|
+
return this.finalMerge(mem.hi(T0), mem.lo(T0), 11);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
class Xxh3_128 extends Xxh3 {
|
|
731
|
+
digestLength = 16;
|
|
732
|
+
constructor() {
|
|
733
|
+
super(17, 0, 0);
|
|
734
|
+
}
|
|
735
|
+
async digest() {
|
|
736
|
+
const len = this.byteCount;
|
|
737
|
+
if (len <= 240) {
|
|
738
|
+
const input = this.getBufferedInput();
|
|
739
|
+
if (len <= 16) {
|
|
740
|
+
return this.digestSmall(input, len);
|
|
741
|
+
}
|
|
742
|
+
return this.digestMedium(input, len);
|
|
743
|
+
}
|
|
744
|
+
return this.digestLarge(len);
|
|
745
|
+
}
|
|
746
|
+
concat(i, j) {
|
|
747
|
+
const result = new Uint8Array(16);
|
|
748
|
+
result.set(this.mem.toBytes(i), 0);
|
|
749
|
+
result.set(this.mem.toBytes(j), 8);
|
|
750
|
+
return result;
|
|
751
|
+
}
|
|
752
|
+
digestSmall(input, len) {
|
|
753
|
+
const { mem } = this;
|
|
754
|
+
const secret = this.secret;
|
|
755
|
+
if (len === 0) {
|
|
756
|
+
const [s00, s01] = readU64LE(secret, 64);
|
|
757
|
+
const [s10, s11] = readU64LE(secret, 72);
|
|
758
|
+
const [s20, s21] = readU64LE(secret, 80);
|
|
759
|
+
const [s30, s31] = readU64LE(secret, 88);
|
|
760
|
+
this.avalanche64(T0, ((s00 ^ s10) >>> 0) ^ this.seed0, ((s01 ^ s11) >>> 0) ^ this.seed1);
|
|
761
|
+
this.avalanche64(T1, ((s20 ^ s30) >>> 0) ^ this.seed0, ((s21 ^ s31) >>> 0) ^ this.seed1);
|
|
762
|
+
return this.concat(T1, T0);
|
|
763
|
+
}
|
|
764
|
+
if (len <= 3) {
|
|
765
|
+
const combined = (input[len - 1] | (len << 8) | (input[0] << 16) | ((input[len >> 1] << 24) >>> 0)) >>> 0;
|
|
766
|
+
const s0 = readU32LE(secret, 0);
|
|
767
|
+
const s1 = readU32LE(secret, 4);
|
|
768
|
+
const s2 = readU32LE(secret, 8);
|
|
769
|
+
const s3 = readU32LE(secret, 12);
|
|
770
|
+
mem
|
|
771
|
+
.write(T0, 0, (s0 ^ s1) >>> 0)
|
|
772
|
+
.add(T0, this.seed0, this.seed1)
|
|
773
|
+
.xor(T0, 0, combined);
|
|
774
|
+
this.avalanche64(T0, mem.hi(T0), mem.lo(T0));
|
|
775
|
+
const bsc = bswap32(combined);
|
|
776
|
+
const rotated = ((bsc << 13) | (bsc >>> 19)) >>> 0;
|
|
777
|
+
mem
|
|
778
|
+
.write(T1, 0, (s2 ^ s3) >>> 0)
|
|
779
|
+
.subtract(T1, this.seed0, this.seed1)
|
|
780
|
+
.xor(T1, 0, rotated);
|
|
781
|
+
this.avalanche64(T1, mem.hi(T1), mem.lo(T1));
|
|
782
|
+
return this.concat(T1, T0);
|
|
783
|
+
}
|
|
784
|
+
if (len <= 8) {
|
|
785
|
+
const inputFirst = readU32LE(input, 0);
|
|
786
|
+
const inputLast = readU32LE(input, len - 4);
|
|
787
|
+
const modSeed0 = (this.seed0 ^ bswap32(this.seed1)) >>> 0;
|
|
788
|
+
const [s00, s01] = readU64LE(secret, 16);
|
|
789
|
+
const [s10, s11] = readU64LE(secret, 24);
|
|
790
|
+
mem
|
|
791
|
+
.write(T0, (s00 ^ s10) >>> 0, (s01 ^ s11) >>> 0)
|
|
792
|
+
.add(T0, modSeed0, this.seed1)
|
|
793
|
+
.xor(T0, inputLast, inputFirst);
|
|
794
|
+
mem.write(T1, PRIME64_1_0, PRIME64_1_1).add(T1, 0, len << 2);
|
|
795
|
+
mem.multiply128(T0, T1, T3, T2);
|
|
796
|
+
mem.copy(T2, T4).left(T4, 1);
|
|
797
|
+
mem.copy(T3, T5).add(T5, mem.hi(T4), mem.lo(T4));
|
|
798
|
+
mem.copy(T5, T4).right(T4, 3);
|
|
799
|
+
mem.xor(T2, mem.hi(T4), mem.lo(T4));
|
|
800
|
+
mem.copy(T2, T4).right(T4, 35);
|
|
801
|
+
mem.xor(T2, mem.hi(T4), mem.lo(T4));
|
|
802
|
+
mem.multiply(T2, PRIME_MX2_0, PRIME_MX2_1);
|
|
803
|
+
mem.copy(T2, T4).right(T4, 28);
|
|
804
|
+
mem.xor(T2, mem.hi(T4), mem.lo(T4));
|
|
805
|
+
this.avalanche(T5, mem.hi(T5), mem.lo(T5));
|
|
806
|
+
return this.concat(T5, T2);
|
|
807
|
+
}
|
|
808
|
+
const [if0, if1] = readU64LE(input, 0);
|
|
809
|
+
const [il0, il1] = readU64LE(input, len - 8);
|
|
810
|
+
const [s00, s01] = readU64LE(secret, 32);
|
|
811
|
+
const [s10, s11] = readU64LE(secret, 40);
|
|
812
|
+
const [s20, s21] = readU64LE(secret, 48);
|
|
813
|
+
const [s30, s31] = readU64LE(secret, 56);
|
|
814
|
+
mem
|
|
815
|
+
.write(T0, (s00 ^ s10) >>> 0, (s01 ^ s11) >>> 0)
|
|
816
|
+
.subtract(T0, this.seed0, this.seed1)
|
|
817
|
+
.xor(T0, if0, if1)
|
|
818
|
+
.xor(T0, il0, il1);
|
|
819
|
+
mem
|
|
820
|
+
.write(T1, (s20 ^ s30) >>> 0, (s21 ^ s31) >>> 0)
|
|
821
|
+
.add(T1, this.seed0, this.seed1)
|
|
822
|
+
.xor(T1, il0, il1);
|
|
823
|
+
mem.write(T2, PRIME64_1_0, PRIME64_1_1);
|
|
824
|
+
mem.multiply128(T0, T2, T4, T3);
|
|
825
|
+
mem.add(T3, ((len - 1) << (54 - 32)) >>> 0, 0);
|
|
826
|
+
mem.add(T4, mem.hi(T1), mem.lo(T1));
|
|
827
|
+
mem.write(T5, 0, mem.lo(T1)).multiply(T5, 0, (PRIME32_2 - 1) >>> 0);
|
|
828
|
+
mem.add(T4, mem.hi(T5), mem.lo(T5));
|
|
829
|
+
mem.xor(T3, bswap32(mem.lo(T4)), bswap32(mem.hi(T4)));
|
|
830
|
+
mem.write(T5, PRIME64_2_0, PRIME64_2_1);
|
|
831
|
+
mem.multiply128(T3, T5, T6, T0);
|
|
832
|
+
mem.multiply(T4, PRIME64_2_0, PRIME64_2_1);
|
|
833
|
+
mem.add(T6, mem.hi(T4), mem.lo(T4));
|
|
834
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
835
|
+
this.avalanche(T6, mem.hi(T6), mem.lo(T6));
|
|
836
|
+
return this.concat(T6, T0);
|
|
837
|
+
}
|
|
838
|
+
digestMedium(input, len) {
|
|
839
|
+
const { mem } = this;
|
|
840
|
+
mem.write(T0, 0, len).multiply(T0, PRIME64_1_0, PRIME64_1_1);
|
|
841
|
+
mem.write(T1, 0, 0);
|
|
842
|
+
if (len <= 128) {
|
|
843
|
+
const numRounds = ((len - 1) >> 5) + 1;
|
|
844
|
+
for (let i = numRounds - 1; i >= 0; i--) {
|
|
845
|
+
this.mixTwoChunks(input, i * 16, len - i * 16 - 16, i * 32);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
for (let i = 0; i < 4; i++) {
|
|
850
|
+
this.mixTwoChunks(input, i * 32, i * 32 + 16, i * 32);
|
|
851
|
+
}
|
|
852
|
+
this.avalanche(T0, mem.hi(T0), mem.lo(T0));
|
|
853
|
+
this.avalanche(T1, mem.hi(T1), mem.lo(T1));
|
|
854
|
+
const numChunks = len >> 5;
|
|
855
|
+
for (let i = 4; i < numChunks; i++) {
|
|
856
|
+
this.mixTwoChunks(input, i * 32, i * 32 + 16, (i - 4) * 32 + 3);
|
|
857
|
+
}
|
|
858
|
+
const sv0 = this.seed0, sv1 = this.seed1;
|
|
859
|
+
this.seed0 = (0 - sv0 - (sv1 > 0 ? 1 : 0)) >>> 0;
|
|
860
|
+
this.seed1 = (0 - sv1) >>> 0;
|
|
861
|
+
this.mixTwoChunks(input, len - 16, len - 32, 103);
|
|
862
|
+
this.seed0 = sv0;
|
|
863
|
+
this.seed1 = sv1;
|
|
864
|
+
}
|
|
865
|
+
const low0 = mem.hi(T0), low1 = mem.lo(T0);
|
|
866
|
+
const high0 = mem.hi(T1), high1 = mem.lo(T1);
|
|
867
|
+
mem.write(T2, low0, low1).add(T2, high0, high1);
|
|
868
|
+
mem.write(T3, low0, low1).multiply(T3, PRIME64_1_0, PRIME64_1_1);
|
|
869
|
+
mem.write(T4, high0, high1).multiply(T4, PRIME64_4_0, PRIME64_4_1);
|
|
870
|
+
mem.add(T3, mem.hi(T4), mem.lo(T4));
|
|
871
|
+
mem.write(T4, 0, len).subtract(T4, this.seed0, this.seed1).multiply(T4, PRIME64_2_0, PRIME64_2_1);
|
|
872
|
+
mem.add(T3, mem.hi(T4), mem.lo(T4));
|
|
873
|
+
const saved0 = mem.hi(T3), saved1 = mem.lo(T3);
|
|
874
|
+
this.avalanche(T2, mem.hi(T2), mem.lo(T2));
|
|
875
|
+
this.avalanche(T4, saved0, saved1);
|
|
876
|
+
mem.write(T5, 0, 0).subtract(T5, mem.hi(T4), mem.lo(T4));
|
|
877
|
+
return this.concat(T5, T2);
|
|
878
|
+
}
|
|
879
|
+
mixTwoChunks(data, offset0, offset1, secretOffset) {
|
|
880
|
+
const { mem } = this;
|
|
881
|
+
const [d100, d101] = readU64LE(data, offset0);
|
|
882
|
+
const [d110, d111] = readU64LE(data, offset0 + 8);
|
|
883
|
+
const [d200, d201] = readU64LE(data, offset1);
|
|
884
|
+
const [d210, d211] = readU64LE(data, offset1 + 8);
|
|
885
|
+
const ms1 = this.mix(data, offset0, secretOffset);
|
|
886
|
+
mem.add(T0, mem.hi(ms1), mem.lo(ms1));
|
|
887
|
+
const ms2 = this.mix(data, offset1, secretOffset + 16);
|
|
888
|
+
mem.add(T1, mem.hi(ms2), mem.lo(ms2));
|
|
889
|
+
mem.write(T5, d200, d201).add(T5, d210, d211);
|
|
890
|
+
mem.xor(T0, mem.hi(T5), mem.lo(T5));
|
|
891
|
+
mem.write(T5, d100, d101).add(T5, d110, d111);
|
|
892
|
+
mem.xor(T1, mem.hi(T5), mem.lo(T5));
|
|
893
|
+
}
|
|
894
|
+
digestLarge(len) {
|
|
895
|
+
const { mem } = this;
|
|
896
|
+
this.finalizeLargeAccumulators();
|
|
897
|
+
mem.write(T0, 0, len).multiply(T0, PRIME64_1_0, PRIME64_1_1);
|
|
898
|
+
const lowBytes = this.finalMerge(mem.hi(T0), mem.lo(T0), 11);
|
|
899
|
+
mem.write(T0, 0, len).multiply(T0, PRIME64_2_0, PRIME64_2_1);
|
|
900
|
+
mem.write(T1, 0xffffffff, 0xffffffff).xor(T1, mem.hi(T0), mem.lo(T0));
|
|
901
|
+
const highBytes = this.finalMerge(mem.hi(T1), mem.lo(T1), SECRET_LENGTH - 75);
|
|
902
|
+
const result = new Uint8Array(16);
|
|
903
|
+
result.set(highBytes, 0);
|
|
904
|
+
result.set(lowBytes, 8);
|
|
905
|
+
return result;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
exports.Xxh3_128 = Xxh3_128;
|
|
910
|
+
exports.Xxh3_128Js = Xxh3_128;
|
|
911
|
+
exports.Xxh3_64 = Xxh3_64;
|
|
912
|
+
exports.Xxh3_64Js = Xxh3_64;
|
|
913
|
+
exports.Xxh64 = Xxh64;
|
|
914
|
+
exports.Xxh64Js = Xxh64;
|