{"id":19778328,"url":"https://github.com/npkgz/crypto-magic","last_synced_at":"2026-07-12T12:32:33.464Z","repository":{"id":66170244,"uuid":"335902761","full_name":"npkgz/crypto-magic","owner":"npkgz","description":"crypto related functions","archived":false,"fork":false,"pushed_at":"2021-02-05T20:10:35.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-24T13:28:23.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/crypto-magic","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npkgz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-04T09:27:30.000Z","updated_at":"2024-09-01T07:28:07.000Z","dependencies_parsed_at":"2023-05-23T19:45:33.353Z","dependency_job_id":null,"html_url":"https://github.com/npkgz/crypto-magic","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"54ec6fd47b9e32384d795b180f1c35459898b815"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/npkgz/crypto-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npkgz%2Fcrypto-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npkgz%2Fcrypto-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npkgz%2Fcrypto-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npkgz%2Fcrypto-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npkgz","download_url":"https://codeload.github.com/npkgz/crypto-magic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npkgz%2Fcrypto-magic/sbom","scorecard":{"id":696193,"data":{"date":"2025-08-11","repo":{"name":"github.com/npkgz/crypto-magic","commit":"54ec6fd47b9e32384d795b180f1c35459898b815"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T03:46:34.794Z","repository_id":66170244,"created_at":"2025-08-22T03:46:34.794Z","updated_at":"2025-08-22T03:46:34.794Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35392296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T05:28:55.627Z","updated_at":"2026-07-12T12:32:33.439Z","avatar_url":"https://github.com/npkgz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"crypto-magic\n==============\n\nA set of utility functions/wrapper to simplify the development workflow\n\n```bash\n$ yarn add crypto-magic\n```\n\nFeatures\n--------\n\n* Hash Function Wrapper (MD5, SHA1, SHA244, SHA256, SHA384, SHA512, WHIRLPOOL)\n* Create Object/Array Hashes based on its JSON representation\n* UUIDv4 generator usinc async crypto api `randomBytes`\n* base64 urlsafe encoder/decoder\n\nHash Function Wrapper\n---------------------\n\nProvides easy access to the [Node.js Crypto Hash](https://nodejs.org/api/crypto.html#crypto_class_hash) functions. Examples are available in [examples/hash.js](examples/hashes.js)\n\n```js\nconst {hash} = require('crypto-magic');\n\nconsole.log(hash.sha256('Hello World'));\n```\n\n##### Initialization #####\n\nThe argument `encoding` is optional and defines the output encoding of the digest.\n\n * **hex** (default) - hexadecimal string output\n * **base64** - base64 string output\n * **base64urlsafe** - url-safe base64 string output (**/+=** are replaced by **_-**)\n * **binary** - binary output as [Buffer](https://nodejs.org/api/buffer.html)\n\n##### Hash Algorithms #####\n\nThe following wrappers are included:\n\n * `md5(input:mixed, [encoding:string])`\n * `sha1(input:mixed, [encoding:string])`\n * `sha2(input:mixed, [encoding:string])`\n * `sha224(input:mixed, [encoding:string])`\n * `sha256(input:mixed, [encoding:string])`\n * `sha384(input:mixed, [encoding:string])`\n * `sha512(input:mixed, [encoding:string])`\n * `whirlpool(input:mixed, [encoding:string])` \n \n### General Usage ###\n\n```js\nconst {hash} = require('crypto-magic');\n\n// some input\nconst input = 'Hello World';\n\n// display some hashes\nconsole.log('Default HEX Output');\nconsole.log(' |- MD5      ', hash.md5(input));\nconsole.log(' |- SHA1     ', hash.sha1(input));\nconsole.log(' |- SHA256   ', hash.sha256(input));\nconsole.log(' |- SHA384   ', hash.sha384(input));\nconsole.log(' |- SHA512   ', hash.sha512(input));\nconsole.log(' |- WHIRLPOOL', hash.whirlpool(input));\n\n// override the default output type\nconsole.log('Override the default output settings');\nconsole.log(' |- HEX      ', hash.sha1(input, 'hex'));\nconsole.log(' |- BIN      ', hash.sha1(input, 'binary'));\nconsole.log(' |- BASE64   ', hash.sha1(input, 'base64'));\nconsole.log('');\n```\n\n### Objects ###\n\nObjects/Arrays are automatically serialized as JSON String. The JSON object is then passed into the hash function.\n\n```js\nconst {hash} = require('crypto-magic');\n\n// demo object\nconst objectInput = {\n    x: 1,\n    b: 2,\n    c: [5,6,7],\n    d: {\n        y: 'Hello',\n        z: 'World'\n    }\n};\n\nconsole.log('Object Input');\nconsole.log(' |- SHA256   ', hash.sha256(objectInput));\n```\n\nRandom Hash Generator\n---------------------\n\nCreate random hashes easily. Just calls the `crypto-magic.hash` functions with a random content generated by `crypto-magic.random(514)` - helpful for random URLs or filenames (e.g. cache hashes).\n\n```js\n// url-safe base64\nconst {randomHash} = require('crypto-magic');\n\n// all hash function of crypto-magic.hash are supported\nconsole.log(await randomHash.sha256('base64urlsafe'));\n\n// output like b7qhqd-WnKAH_GmBpSpvQrdkfUdLxL0m__XGcLTRsbI\n```\n\n## License ##\ncrypto-magic is OpenSource and licensed under the Terms of [The MIT License (X11)](http://opensource.org/licenses/MIT) - your're welcome to contribute\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpkgz%2Fcrypto-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpkgz%2Fcrypto-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpkgz%2Fcrypto-magic/lists"}