{"_id":"@cosmixclub/crypto","_rev":"6-771995f3309ab9eae64f379358d85f8e","name":"@cosmixclub/crypto","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@cosmixclub/crypto","version":"1.0.0","keywords":["crypto","scrypt"],"author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","_id":"@cosmixclub/crypto@1.0.0","maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"}],"homepage":"https://github.com/cosmixclub/crypto","bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"dist":{"shasum":"767ae363967dcb840933a8e97431d58dceed80fe","tarball":"https://registry.npmjs.org/@cosmixclub/crypto/-/crypto-1.0.0.tgz","fileCount":7,"integrity":"sha512-/dL5s/WncJLuBbVNvoecBEiRtuiEj/5VWblzA37h4IvPrITb+HnxXNzI31/2/Rs6MyfdAYoDDuibPcYC2ImUDQ==","signatures":[{"sig":"MEYCIQCzs6g0jp3tTO7lbskcmz3XL12x/tvrMYRuBDYAS9bjSQIhAOGr1JmSqLKUGl7HBVkPSj5a5pWB5c/R99yAApdYFp/s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29020},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"ff2827394f78f407bc3fcbf9b06b37e7ccad50d4","scripts":{"ci":"pnpm build && pnpm check-format && pnpm check-exports","lint":"eslint --fix .","build":"tsup","commit":"git cz","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack .","local-release":"changeset version && changeset publish","prepublishOnly":"pnpm run ci"},"_npmUser":{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},"repository":{"url":"git+https://github.com/cosmixclub/crypto.git","type":"git"},"_npmVersion":"10.8.1","description":"Criptografia determinística de informações","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"packageManager":"pnpm@9.12.2","devDependencies":{"tsup":"^8.3.0","eslint":"8.57.0","prettier":"^3.3.3","commitizen":"^4.3.1","typescript":"^5.6.3","@types/node":"^22.7.9","@changesets/cli":"^2.27.9","@vercel/style-guide":"^6.0.0","@arethetypeswrong/cli":"^0.16.4","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@typescript-eslint/parser":"^8.11.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-perfectionist":"^3.9.1","@typescript-eslint/eslint-plugin":"^8.11.0","@trivago/prettier-plugin-sort-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_1.0.0_1729730703425_0.7911227601176214","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@cosmixclub/crypto","version":"1.0.1","keywords":["crypto","scrypt"],"author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","_id":"@cosmixclub/crypto@1.0.1","maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"}],"homepage":"https://github.com/cosmixclub/crypto","bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"dist":{"shasum":"d2997d5ad5091c872323cf1a726158f606b24915","tarball":"https://registry.npmjs.org/@cosmixclub/crypto/-/crypto-1.0.1.tgz","fileCount":7,"integrity":"sha512-+b7xELqCDPMpqsDJ+jweYHC0gk0t6rzecl0JyCZxbx0AN3RTBwTnt4L/3DivgpgL8ceIMUN0NEwB658cK7yG5g==","signatures":[{"sig":"MEUCIQDNE9p1kQJr+8yYOMjJzwYOkiYnj2MsyH3/2LP5Aes0LAIgX+saVIBe4/rgzC64Ab47FgrjZD7/DbHVF4KeR/yQdgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28930},"main":"dist/index.js","type":"module","_from":"file:cosmixclub-crypto-1.0.1.tgz","types":"./dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"ci":"pnpm build && pnpm check-format && pnpm check-exports","lint":"eslint --fix .","build":"tsup","commit":"git cz","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack .","local-release":"changeset version && changeset publish"},"_npmUser":{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},"_resolved":"/tmp/b4b8a13c00be615398f71527105c066b/cosmixclub-crypto-1.0.1.tgz","_integrity":"sha512-+b7xELqCDPMpqsDJ+jweYHC0gk0t6rzecl0JyCZxbx0AN3RTBwTnt4L/3DivgpgL8ceIMUN0NEwB658cK7yG5g==","repository":{"url":"git+https://github.com/cosmixclub/crypto.git","type":"git"},"_npmVersion":"10.8.1","description":"Criptografia determinística de informações","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"8.57.0","prettier":"^3.3.3","commitizen":"^4.3.1","typescript":"^5.6.3","@types/node":"^22.7.9","@changesets/cli":"^2.27.9","@vercel/style-guide":"^6.0.0","@arethetypeswrong/cli":"^0.16.4","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@typescript-eslint/parser":"^8.11.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-perfectionist":"^3.9.1","@typescript-eslint/eslint-plugin":"^8.11.0","@trivago/prettier-plugin-sort-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_1.0.1_1729730819054_0.6362889857293608","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@cosmixclub/crypto","version":"1.2.0","keywords":["crypto","scrypt"],"author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","_id":"@cosmixclub/crypto@1.2.0","maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"}],"homepage":"https://github.com/cosmixclub/crypto","bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"dist":{"shasum":"6cac6d61598d47b27577788c778e8796b5a7cf58","tarball":"https://registry.npmjs.org/@cosmixclub/crypto/-/crypto-1.2.0.tgz","fileCount":7,"integrity":"sha512-4UAakIajSVRO8dCUFU8f66f5QeNdMb2JJWJZWDBrQXC/n7SPueYhstSrcCMdAnHVE9vR+fwqAXUQQhkZXtZY0w==","signatures":[{"sig":"MEUCICIKwiV0USgqT1xLUWlIuC6EIDRIcR/iSkhb3FXgQjlmAiEA7UC0ehKy1bgQ/E5Q6hDO+A1Y4IYpg7ynIrRDTpvO3Lk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40259},"main":"dist/index.js","type":"module","_from":"file:cosmixclub-crypto-1.2.0.tgz","types":"./dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"ci":"pnpm build && pnpm check-format && pnpm check-exports","lint":"eslint --fix .","build":"tsup","commit":"git cz","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack .","local-release":"changeset version && changeset publish"},"_npmUser":{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},"_resolved":"/tmp/d3912b00b4e801a28e31986b3c076a69/cosmixclub-crypto-1.2.0.tgz","_integrity":"sha512-4UAakIajSVRO8dCUFU8f66f5QeNdMb2JJWJZWDBrQXC/n7SPueYhstSrcCMdAnHVE9vR+fwqAXUQQhkZXtZY0w==","repository":{"url":"git+https://github.com/cosmixclub/crypto.git","type":"git"},"_npmVersion":"10.5.0","description":"Criptografia determinística de informações","directories":{},"_nodeVersion":"21.7.3","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"8.57.0","prettier":"^3.3.3","commitizen":"^4.3.1","typescript":"^5.6.3","@types/node":"^22.7.9","@changesets/cli":"^2.27.9","@vercel/style-guide":"^6.0.0","@arethetypeswrong/cli":"^0.16.4","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@typescript-eslint/parser":"^8.11.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-perfectionist":"^3.9.1","@typescript-eslint/eslint-plugin":"^8.11.0","@trivago/prettier-plugin-sort-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_1.2.0_1730042967488_0.7085705994712403","host":"s3://npm-registry-packages"}},"1.2.2":{"name":"@cosmixclub/crypto","version":"1.2.2","keywords":["crypto","scrypt"],"author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","_id":"@cosmixclub/crypto@1.2.2","maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"}],"homepage":"https://github.com/cosmixclub/crypto","bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"dist":{"shasum":"feeb3605e5d286910991b4692c8ce0c79a2f2c96","tarball":"https://registry.npmjs.org/@cosmixclub/crypto/-/crypto-1.2.2.tgz","fileCount":7,"integrity":"sha512-Zvu5VFHIW4KcVFy78yojtdGFmnLulUjKqivevuDQD05wNWhvVwfRE4/TwQiJwWSerA/wdeA0Ohdnt6eeK0h5TQ==","signatures":[{"sig":"MEYCIQCftizt5TArJJ85jChVww/2Pvr4DusKQ+JeKABvH5EdNgIhAKNHmwqG3omJS8mWCCtEUAS+TgOcqRL243MAjs+vcvpB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40215},"main":"dist/index.js","type":"module","_from":"file:cosmixclub-crypto-1.2.2.tgz","types":"./dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"ci":"pnpm build && pnpm check-format && pnpm check-exports","lint":"eslint --fix .","build":"tsup","commit":"git cz","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack .","local-release":"changeset version && changeset publish"},"_npmUser":{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},"_resolved":"/tmp/6fa29e467f35ab08984849b18006d847/cosmixclub-crypto-1.2.2.tgz","_integrity":"sha512-Zvu5VFHIW4KcVFy78yojtdGFmnLulUjKqivevuDQD05wNWhvVwfRE4/TwQiJwWSerA/wdeA0Ohdnt6eeK0h5TQ==","repository":{"url":"git+https://github.com/cosmixclub/crypto.git","type":"git"},"_npmVersion":"10.5.0","description":"Criptografia determinística de informações","directories":{},"_nodeVersion":"21.7.3","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","eslint":"8.57.0","prettier":"^3.3.3","commitizen":"^4.3.1","typescript":"^5.6.3","@types/node":"^22.7.9","@changesets/cli":"^2.27.9","@vercel/style-guide":"^6.0.0","@arethetypeswrong/cli":"^0.16.4","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@typescript-eslint/parser":"^8.11.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-perfectionist":"^3.9.1","@typescript-eslint/eslint-plugin":"^8.11.0","@trivago/prettier-plugin-sort-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_1.2.2_1731006165715_0.27411664028032656","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"@cosmixclub/crypto","version":"1.3.0","description":"Criptografia determinística de informações","author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","main":"dist/index.js","keywords":["crypto","scrypt"],"homepage":"https://github.com/cosmixclub/crypto","bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"repository":{"type":"git","url":"git+https://github.com/cosmixclub/crypto.git"},"type":"module","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"import":"./dist/index.js","default":"./dist/index.cjs"}},"devDependencies":{"@arethetypeswrong/cli":"^0.16.4","@changesets/cli":"^2.27.9","@trivago/prettier-plugin-sort-imports":"^4.3.0","@types/node":"^22.7.9","@typescript-eslint/eslint-plugin":"^8.11.0","@typescript-eslint/parser":"^8.11.0","@vercel/style-guide":"^6.0.0","commitizen":"^4.3.1","cz-conventional-changelog":"^3.3.0","eslint":"8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-perfectionist":"^3.9.1","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","tsup":"^8.3.0","typescript":"^5.6.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"scripts":{"ci":"pnpm build && pnpm check-format && pnpm check-exports","build":"tsup","lint":"eslint --fix .","format":"prettier --write .","check-format":"prettier --check .","commit":"git cz","check-exports":"attw --pack .","local-release":"changeset version && changeset publish"},"_id":"@cosmixclub/crypto@1.3.0","_integrity":"sha512-rCZ/oE22kgrjbW0CfEa2mTPa/8+uvbR/CaPr9M6KibnxRMEDKA+g4NXoCsiUOU2vsv8vg2PB16bQmRqevIbwXA==","_resolved":"/tmp/efc3d97bd8fcead6958f4e05f229a4f0/cosmixclub-crypto-1.3.0.tgz","_from":"file:cosmixclub-crypto-1.3.0.tgz","_nodeVersion":"21.7.3","_npmVersion":"10.5.0","dist":{"integrity":"sha512-rCZ/oE22kgrjbW0CfEa2mTPa/8+uvbR/CaPr9M6KibnxRMEDKA+g4NXoCsiUOU2vsv8vg2PB16bQmRqevIbwXA==","shasum":"5ff8a2a62f9152454bb2a57fc942652058b042f4","tarball":"https://registry.npmjs.org/@cosmixclub/crypto/-/crypto-1.3.0.tgz","fileCount":7,"unpackedSize":49591,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC0+ogKqzYE/Kkfw/ANcb3SXrjMXH8MPYSEvcbsBSPIDgIhALEq6ZzZrYuB1eiimN6ee5ZM1jHlzSap7kQSJUXmwg5Q"}]},"_npmUser":{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},"directories":{},"maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},{"name":"alex-custodio","email":"alex.scustod@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/crypto_1.3.0_1754924963338_0.41626041632816646"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-24T00:45:03.122Z","modified":"2025-08-11T15:09:23.715Z","1.0.0":"2024-10-24T00:45:03.588Z","1.0.1":"2024-10-24T00:46:59.267Z","1.2.0":"2024-10-27T15:29:27.686Z","1.2.2":"2024-11-07T19:02:45.898Z","1.3.0":"2025-08-11T15:09:23.511Z"},"bugs":{"url":"https://github.com/cosmixclub/crypto/issues"},"author":{"name":"Gepetojj","email":"contato.gepetojj@gmail.com"},"license":"MIT","homepage":"https://github.com/cosmixclub/crypto","keywords":["crypto","scrypt"],"repository":{"type":"git","url":"git+https://github.com/cosmixclub/crypto.git"},"description":"Criptografia determinística de informações","maintainers":[{"name":"gepetojj","email":"nmjoaopedro22@gmail.com"},{"name":"alex-custodio","email":"alex.scustod@gmail.com"}],"readme":"## @cosmixclub/crypto\r\n\r\nEste pacote fornece funções robustas de criptografia e descriptografia utilizando o algoritmo AES-256-GCM, com chaves derivadas por meio de Argon2 e suporte para operações de criptografia em strings e objetos aninhados. Além disso, oferece funcionalidades para geração de hash de strings e propriedades específicas de objetos usando diversos algoritmos de hash.\r\n\r\n### Índice\r\n\r\n-   [@cosmixclub/crypto](#cosmixclubcrypto)\r\n    -   [Índice](#índice)\r\n-   [Instalação](#instalação)\r\n-   [Uso](#uso)\r\n    -   [Configurando](#configurando)\r\n    -   [Criptografando uma String](#criptografando-uma-string)\r\n    -   [Criptografando Objetos](#criptografando-objetos)\r\n    -   [Descriptografando uma String](#descriptografando-uma-string)\r\n    -   [Descriptografando em Lote](#descriptografando-em-lote)\r\n    -   [Descriptografando Objetos](#descriptografando-objetos)\r\n    -   [Gerando Hash de Strings](#gerando-hash-de-strings)\r\n    -   [Gerando Hash de Objetos](#gerando-hash-de-objetos)\r\n-   [API](#api)\r\n    -   [Funções de Criptografia](#funções-de-criptografia)\r\n        -   [`encrypt(config: CryptoConfig)`](#encryptconfig-cryptoconfig)\r\n    -   [Funções de Descriptografia](#funções-de-descriptografia)\r\n        -   [`decrypt(config: CryptoConfig)`](#decryptconfig-cryptoconfig)\r\n    -   [Funções de Hash](#funções-de-hash)\r\n        -   [`hash(algorithm: HashAlgorithm)`](#hashalgorithm-hashalgorithm)\r\n-   [Erros](#erros)\r\n    -   [Tipos de Erros](#tipos-de-erros)\r\n-   [Contribuição](#contribuição)\r\n\r\n## Instalação\r\n\r\n```bash\r\npnpm add @cosmixclub/crypto\r\n```\r\n\r\n## Uso\r\n\r\n### Configurando\r\n\r\nAs funções `encrypt` e `decrypt` necessitam de um objeto de configuração com as chaves secretas e contexto adicional (opcional). Tome cuidado com o armazenamento das suas chaves e contexto, vazamentos irão comprometer a segurança dos seus dados.\r\n\r\n```typescript\r\nimport { type CryptoConfig } from \"@cosmixclub/crypto\";\r\n\r\nconst config: CryptoConfig = {\r\n\tprivacyKey: \"uma_chave_privada_secreta_de_32_caracteres_no_minimo\",\r\n\tprivacySalt: \"um_salt_aleatorio_de_16_caracteres_no_minimo\",\r\n\tcontext: [\"context1\", \"context2\"], // Opcional\r\n\t// Opcional: escolha da codificação dos campos iv/encryptedData/authTag.\r\n\t// Padrão é \"hex\" (compatibilidade). Para melhor performance/payload menor, use \"base64\".\r\n\t// encoding: \"base64\",\r\n};\r\n```\r\n\r\n### Criptografando uma String\r\n\r\nVocê pode usar a função `fromString` para criptografar uma string de texto simples. A chave de criptografia é derivada de uma chave de privacidade e um sal dinâmico.\r\n\r\n```typescript\r\nimport { encrypt } from \"@cosmixclub/crypto\";\r\n\r\nconst encryptedString = encrypt(config).fromString(\"Hello World\");\r\nconsole.log(\"Encrypted String:\", encryptedString);\r\n```\r\n\r\n### Criptografando Objetos\r\n\r\nA função `fromObject` permite criptografar seletivamente as propriedades de um objeto, incluindo suporte para objetos aninhados e arrays.\r\n\r\nAssim como na função `decrypt`, o usuário tem a opção de passar uma lista de chaves do objeto para selecionar quais valores serão decriptados. Se nenhum valor for passado, ou a lista não for passada, todos os valores serão criptografados/decriptografados.\r\n\r\n```typescript\r\nimport { encrypt } from \"@cosmixclub/crypto\";\r\n\r\nconst user = {\r\n\tname: \"John Doe\",\r\n\temail: \"john@example.com\",\r\n\tage: 30,\r\n};\r\n\r\nconst encryptedUser = encrypt(config).fromObject(user, [\"email\"]);\r\nconsole.log(\"Encrypted Object:\", encryptedUser);\r\n```\r\n\r\n### Descriptografando uma String\r\n\r\nPara descriptografar uma string criptografada, você pode usar a função `fromString` no módulo `decrypt`.\r\n\r\n```typescript\r\nimport { decrypt } from \"@cosmixclub/crypto\";\r\n\r\nconst decryptedString = decrypt(config).fromString(encryptedString);\r\nconsole.log(\"Decrypted String:\", decryptedString);\r\n```\r\n\r\n### Descriptografando em Lote\r\n\r\nPara listas grandes (ex: últimas mensagens de vários chats), você pode usar os helpers de lote.\r\n\r\n```ts\r\nimport { decrypt } from \"@cosmixclub/crypto\";\r\n\r\nconst d = decrypt(config);\r\n// Síncrono (rápido, baixo overhead para lotes pequenos/médios)\r\nconst results = d.fromManyStrings([enc1, enc2, enc3]);\r\n\r\n// Assíncrono com paralelismo (worker threads) para lotes grandes\r\nconst resultsParallel = await d.fromManyStringsAsync([enc1, enc2, enc3], { concurrency: 4, minParallel: 50 });\r\n```\r\n\r\n### Descriptografando Objetos\r\n\r\nA função `fromObject` no módulo `decrypt` pode descriptografar propriedades específicas de um objeto, permitindo também trabalhar com objetos aninhados e arrays.\r\n\r\n```typescript\r\nimport { decrypt } from \"@cosmixclub/crypto\";\r\n\r\nconst decryptedUser = decrypt(config).fromObject(encryptedUser, [\"email\"]);\r\nconsole.log(\"Decrypted User:\", decryptedUser);\r\n```\r\n\r\n### Gerando Hash de Strings\r\n\r\nUtilize a função `fromString` para gerar o hash de uma string. Por padrão, o algoritmo SHA-512 é utilizado, mas você pode especificar outros algoritmos suportados.\r\n\r\n```typescript\r\nimport { hash } from \"@cosmixclub/crypto\";\r\n\r\nconst hashedString = hash(\"sha256\").fromString(\"Hello World\");\r\nconsole.log(\"Hashed String:\", hashedString);\r\n```\r\n\r\n### Gerando Hash de Objetos\r\n\r\nA função `fromObject` permite gerar hash de propriedades específicas de um objeto, com suporte para dot notation. Esta função evita aplicar hash em tipos complexos (como funções e instâncias de classes) e permite gerar hash de objetos aninhados ou arrays.\r\n\r\n```typescript\r\nimport { hash } from \"@cosmixclub/crypto\";\r\n\r\nconst user = {\r\n\tname: \"John Doe\",\r\n\tpassword: \"supersecret\",\r\n\tprofile: {\r\n\t\temail: \"john@example.com\",\r\n\t\tphone: \"123456789\",\r\n\t},\r\n};\r\n\r\nconst hashedUser = hash(\"sha512\").fromObject(user, [\"password\", \"profile.email\"]);\r\nconsole.log(\"Hashed Object:\", hashedUser);\r\n```\r\n\r\n## API\r\n\r\n### Funções de Criptografia\r\n\r\n#### `encrypt(config: CryptoConfig)`\r\n\r\n-   **Parâmetros**:\r\n    -   `config` (Object): Objeto de configuração para criptografia.\r\n-   **Retorno**: Um objeto com as funções:\r\n    -   `fromString(plainText: string): string`: Criptografa uma string.\r\n    -   `fromManyStrings(plainTexts: string[]): string[]`: Criptografa várias strings de forma síncrona.\r\n    -   `fromObject<I, K>(obj: I, keys?: K[]): EncryptNestedKeys<I, K>`: Criptografa as chaves especificadas de um objeto.\r\n\r\n### Funções de Descriptografia\r\n\r\n#### `decrypt(config: CryptoConfig)`\r\n\r\n-   **Parâmetros**:\r\n    -   `config` (Object): Configuração usada na criptografia.\r\n-   **Retorno**: Um objeto com as funções:\r\n    -   `fromString(content: string): string`: Descriptografa uma string.\r\n    -   `fromManyStrings(contents: string[]): string[]`: Descriptografa várias strings de forma síncrona.\r\n    -   `fromManyStringsAsync(contents: string[], options?: { concurrency?: number; minParallel?: number }): Promise<string[]>`: Descriptografa várias strings com paralelismo.\r\n    -   `fromObject<I>(obj: I, list?: string[]): I`: Descriptografa as chaves especificadas de um objeto.\r\n\r\n### Funções de Hash\r\n\r\n#### `hash(algorithm: HashAlgorithm)`\r\n\r\n-   **Parâmetros**:\r\n    -   `algorithm` (string, opcional): Algoritmo de hash a ser utilizado. Suporta `\"sha1\"`, `\"sha256\"`, `\"sha384\"`, `\"sha512\"`, `\"md5\"`, e `\"ripemd160\"`. O padrão é `\"sha512\"`.\r\n-   **Retorno**: Um objeto com as funções:\r\n    -   `fromString(str: string): string`: Gera o hash de uma string.\r\n    -   `fromObject<I, K>(obj: I, keys?: K[]): EncryptNestedKeys<I, K>`: Gera o hash de propriedades específicas de um objeto com suporte a dot notation.\r\n\r\n## Erros\r\n\r\nO pacote lança erros personalizados para facilitar a identificação de problemas.\r\n\r\n### Tipos de Erros\r\n\r\n-   **CryptoError**: Classe base para todos os erros de criptografia.\r\n-   **InvalidPrefixError**: Prefixo inválido na string criptografada.\r\n-   **InvalidIVError**: IV inválido.\r\n-   **InvalidCiphertextError**: Ciphertext inválido.\r\n-   **InvalidAuthTagError**: `authTag` inválido.\r\n-   **EncryptionFailedError**: Erro ao criptografar.\r\n-   **DecryptionFailedError**: Erro ao descriptografar.\r\n-   **HashFailedError**: Erro ao gerar hash.\r\n\r\n## Contribuição\r\n\r\n1. Faça um fork do repositório.\r\n2. Crie uma nova branch (`git checkout -b feature/nova-funcionalidade`).\r\n3. Faça commit das alterações (`git commit -m 'Adiciona nova funcionalidade'`).\r\n4. Envie para a branch (`git push origin feature/nova-funcionalidade`).\r\n5. Abra um Pull Request.\r\n\r\n---\r\n\r\nEste pacote é projetado para fornecer uma maneira segura e eficiente de criptografar, descriptografar e hashear dados, com funcionalidades adicionais para criptografia seletiva em objetos aninhados e arrays, além de suporte a múltiplos algoritmos de hash para diferentes necessidades de segurança.\r\n","readmeFilename":"README.md"}