{"id":19001855,"url":"https://github.com/generalsimus/ciphernum","last_synced_at":"2026-04-20T00:30:24.749Z","repository":{"id":226955247,"uuid":"770056414","full_name":"Generalsimus/CipherNum","owner":"Generalsimus","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-08T00:43:31.000Z","size":130,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T21:18:17.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Generalsimus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-10T19:49:51.000Z","updated_at":"2024-03-10T19:50:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ade9cd0-2747-4de1-8d23-4ecad7bdad6f","html_url":"https://github.com/Generalsimus/CipherNum","commit_stats":null,"previous_names":["generalsimus/ciphernum"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Generalsimus%2FCipherNum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Generalsimus%2FCipherNum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Generalsimus%2FCipherNum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Generalsimus%2FCipherNum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Generalsimus","download_url":"https://codeload.github.com/Generalsimus/CipherNum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240021871,"owners_count":19735387,"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-08T18:13:04.386Z","updated_at":"2026-04-20T00:30:24.638Z","avatar_url":"https://github.com/Generalsimus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### CipherNum\n\n[![Standard JS][standard-js-src]][standard-js-href]\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\n\u003c!-- Refs --\u003e\n[standard-js-src]: https://img.shields.io/badge/license-MIT-brightgreen?\u0026style=flat-square\n[standard-js-href]: https://github.com/Generalsimus/CipherNum/blob/master/LICENSE\n\n[npm-version-src]: https://img.shields.io/npm/v/ciphernum?\u0026style=flat-square\n[npm-version-href]: https://www.npmjs.com/package/ciphernum\n\n[npm-downloads-src]: https://img.shields.io/npm/dt/ciphernum?\u0026style=flat-square\n[npm-downloads-href]: https://www.npmjs.com/package/ciphernum\n\n[bundle-phobia-src]: https://img.shields.io/bundlephobia/min/ciphernum?\u0026style=flat-square\u0026color=red\n[bundle-phobia-href]: https://packagephobia.com/result?p=ciphernum\n\n## Usage\nThe CipherNum npm package offers a unique solution for converting numbers into a string of characters and accurately recovering the original numbers from these character strings. This conversion process works seamlessly with both standard numbers and BigInts, compact data representation, or any scenario where numbers need to be converted to a non-standard string format for storage, transmission, or processing, and then precisely recovered.\n\n### Number Encryption\n\n#### Number\n\n\n```ts\nimport { createNumberCipher } from \"ciphernum\";\n\nconst cipher = createNumberCipher({\n    characters: \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n    wordLength: 5,\n});\n\nconst testNumber = 523827512\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"PZqz0\"\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 523827512\n```\n\n\n```ts\nimport { createNumberCipher } from \"ciphernum\";\n\nconst cipher = createNumberCipher({\n    wordLength: 5,\n});\n\nconst testNumber = 432543261234\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"\\x00\\x00d뤝\" \n\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 432543261234\n```\n\n```ts\nimport { createNumberCipher } from \"ciphernum\";\n\nconst cipher = createNumberCipher();\n\nconst testNumber = 8234346565437\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"ݽ䑇谇\" \n\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 8234346565437\n```\n\n#### Bigint\n```ts\nimport { createBigintCipher } from \"ciphernum\";\n\nconst cipher = createBigintCipher({\n  characters: \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n  wordLength: 5n,\n});\n\nconst testNumber = 523412315n;\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"JAlCh\"\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 523412315n\n```\n\n```ts\nimport { createBigintCipher } from \"ciphernum\";\n\nconst cipher = createBigintCipher({\n  wordLength: 5n,\n});\n\nconst testNumber = 43253461232122443261234n;\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"नﮌ\\ud899\"\n\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 43253461232122443261234n\n```\n\n```ts\nimport { createBigintCipher } from \"ciphernum\";\n\nconst cipher = createBigintCipher()\n\nconst testNumber = 8234346565437n\n\nconst encodedAsString = cipher.encode(testNumber);\n// encodedAsString = \"ݽ䑇谇\" \n\nconst decodedAsNumber = cipher.decode(encodedAsString);\n// decodedAsNumber = 8234346565437n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneralsimus%2Fciphernum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneralsimus%2Fciphernum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneralsimus%2Fciphernum/lists"}