{"id":19547467,"url":"https://github.com/sodium-friends/sodium-javascript","last_synced_at":"2025-04-06T22:06:41.522Z","repository":{"id":16416597,"uuid":"79902151","full_name":"sodium-friends/sodium-javascript","owner":"sodium-friends","description":"Pure Javascript version of sodium-native","archived":false,"fork":false,"pushed_at":"2023-06-02T14:58:44.000Z","size":2553,"stargazers_count":92,"open_issues_count":25,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T21:06:16.454Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sodium-friends.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":"2017-01-24T10:41:09.000Z","updated_at":"2024-06-16T05:51:21.000Z","dependencies_parsed_at":"2024-06-18T13:46:19.098Z","dependency_job_id":"1b501522-c840-4f88-be15-15cac3641d8c","html_url":"https://github.com/sodium-friends/sodium-javascript","commit_stats":{"total_commits":96,"total_committers":15,"mean_commits":6.4,"dds":0.625,"last_synced_commit":"ae2df3305e0cff68c3ae922813bfbb2d361d78de"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sodium-friends%2Fsodium-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sodium-friends%2Fsodium-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sodium-friends%2Fsodium-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sodium-friends%2Fsodium-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sodium-friends","download_url":"https://codeload.github.com/sodium-friends/sodium-javascript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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-11T03:49:56.679Z","updated_at":"2025-04-06T22:06:41.502Z","avatar_url":"https://github.com/sodium-friends.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `sodium-javascript`\n\n[![Build Status](https://travis-ci.org/sodium-friends/sodium-javascript.svg?branch=master)](https://travis-ci.org/sodium-friends/sodium-javascript)\n\n\u003e WIP - a pure javascript version of [sodium-native](https://github.com/sodium-friends/sodium-native).\nBased on tweetnacl\n\n## Usage\n\n``` js\nconst sodium = require('sodium-javascript')\n\nconst key = Buffer.alloc(sodium.crypto_secretbox_KEYBYTES)\nconst nonce = Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES)\n\nsodium.randombytes_buf(key)\nsodium.randombytes_buf(nonce)\n\nconst message = Buffer.from('Hello, World!')\nconst cipher = Buffer.alloc(message.length + sodium.crypto_secretbox_MACBYTES)\n\nsodium.crypto_secretbox_easy(cipher, message, nonce, key)\n\nconsole.log('Encrypted:', cipher)\n\nconst plainText = Buffer.alloc(cipher.length - sodium.crypto_secretbox_MACBYTES)\n\nsodium.crypto_secretbox_open_easy(plainText, cipher, nonce, key)\n\nconsole.log('Plaintext:', plainText.toString())\n```\n\n## API\n\nSee [sodium-native](https://github.com/sodium-friends/sodium-native).\nThis is a work in progress so not all functions are implemented yet.\n\nThis module is organised into individual submodules which can be required\nindependently for smaller bundles in the browser. To leverage automatic\nswitching between `sodium-javascript` and `sodium-native`, see\n[`sodium-universal`](https://github.com/sodium-friends/sodium-universal).\n\n## Install\n\n```\nnpm install sodium-javascript\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsodium-friends%2Fsodium-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsodium-friends%2Fsodium-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsodium-friends%2Fsodium-javascript/lists"}