{"id":21414888,"url":"https://github.com/magic/cryptography","last_synced_at":"2025-03-16T18:42:05.804Z","repository":{"id":31636674,"uuid":"128490507","full_name":"magic/cryptography","owner":"magic","description":"please note that this library is not in use in any of my other libraries (yet). consider it to be experimental at best.","archived":false,"fork":false,"pushed_at":"2023-02-11T15:34:21.000Z","size":488,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T05:27:12.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-04-07T02:48:35.000Z","updated_at":"2023-02-11T15:32:06.000Z","dependencies_parsed_at":"2024-11-22T18:36:05.536Z","dependency_job_id":"e895d81b-0081-476b-a17a-ad0840cda3f0","html_url":"https://github.com/magic/cryptography","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fcryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fcryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fcryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fcryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magic","download_url":"https://codeload.github.com/magic/cryptography/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243911273,"owners_count":20367651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-22T18:34:24.964Z","updated_at":"2025-03-16T18:42:05.779Z","avatar_url":"https://github.com/magic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @magic/cryptography\n\nmagic cryptography utilities\n\nnot in use anywhere. do not use.\n\n[![NPM version][npm-image]][npm-url]\n[![Linux Build Status][travis-image]][travis-url]\n[![Windows Build Status][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n\n[npm-image]: https://img.shields.io/npm/v/@magic/cryptography.svg\n[npm-url]: https://www.npmjs.com/package/@magic/cryptography\n[travis-image]: https://api.travis-ci.org/magic/cryptography.svg?branch=master\n[travis-url]: https://travis-ci.org/magic/cryptography\n[appveyor-image]: https://img.shields.io/appveyor/ci/magic/cryptography/master.svg\n[appveyor-url]: https://ci.appveyor.com/project/magic/cryptography/branch/master\n[coveralls-image]: https://coveralls.io/repos/github/magic/cryptography/badge.svg\n[coveralls-url]: https://coveralls.io/github/magic/cryptography\n[greenkeeper-image]: https://badges.greenkeeper.io/magic/cryptography.svg\n[greenkeeper-url]: https://badges.greenkeeper.io/magic/cryptography.svg\n[snyk-image]: https://snyk.io/test/github/magic/cryptography/badge.svg\n[snyk-url]: https://snyk.io/test/github/magic/cryptography\n\n#### functions:\n\n##### hash\n\n##### jwt\n\nProvides jwts using [jsonwebtoken](https://npmjs.com/package/jsonwebtoken)\n\n##### random\n\nGet random values\n\n```javascript\n  import { random } from '@magic/cryptography'\n\n  const randomValues = async () =\u003e {\n    const num = await random.number({\n      min: Number.MIN_SAFE_INTEGER,\n      max: Number.MAX_SAFE_INTEGER,\n    })\n\n    const nums = await random.numbers(10)\n    // get 10 random numbers. clamping not implemented yet.\n\n    const bytes = await random.bytes(33)\n    // get 33 random bytes (... a string).\n```\n\n##### uuid\n\nGenerate v4 and (namespaced) v5 uuids using the [uuid](https://npmjs.com/package/uuid) package\n\n```javascript\nimport { uuid } from '@magic/cryptography'\n\nconst v4 = uuid.v4()\n\n// uuid v5 namespaces\nconst { DNS, URL, OID, X500 } = uuid.v5\n\nconst namespaceUuid = uuid.addNS('name')\nconst v5 = uuid.v5(namespaceUuid || 'name', DNS)\n```\n\n##### word\n\nGet a single random word from the wordlist\n\n```javascript\nimport { word } from '@magic/cryptography'\n\nconst generateWord = async () =\u003e {\n  const randomWord = await word()\n  return randomWord\n}\ngenerateWord()\n```\n\n##### words\n\nGet multiple random words from the wordlist\n\n```javascript\nconst generateWords = async () =\u003e {\n  const randomWords = await words(10)\n  return randomWords\n}\ngenerateWords()\n```\n\n##### wordlist\n\nList with ~7000 words.\n\n#### changelog\n\n##### 0.0.1 - UNRELEASED\n\nfirst release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Fcryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagic%2Fcryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Fcryptography/lists"}