{
"repo": "sodium-universal",
"timestamp": "2026-01-16T23:39:36.893Z",
"entryPoint": "index.js",
"exports": {
"packageJson": {
"main": "index.js"
}
},
"api": {},
"readme": {
"content": "# sodium-universal\n\nUniversal wrapper for `sodium-javascript` and `sodium-native` working in Node.js and the Browser\n\n```sh\nnpm install sodium-universal\n```\n\n`sodium-native` ships with prebuilds for macOS, Windows, and Linux.\n\nNote that the module itself is generated on a prepublish hook.\n\n## Usage\n\n```js\nvar sodium = require('sodium-universal')\n\nvar rnd = Buffer.allocUnsafe(12) // Cryptographically random data\nsodium.randombytes_buf(rnd)\n\nconsole.log(rnd.toString('hex'))\n```\n\nWorks seamlessly with Node.js:\n\n```sh\n$ node example.js\nc7dbd46a6cc84ff2e0d1285c\n```\n\nAnd the browser:\n\nFirst install the peer dep, `sodium-javascript`.\n\n```sh\nnpm install --save sodium-javascript\n```\n\nAnd then browserify\n\n```sh\nbrowserify example.js > bundle.js\n```\n\n## Introduction\n\n[`libsodium`](https://download.libsodium.org/doc/) is a collection of cryptographic primitives, providing a low-level foundation to build higher-level cryptographic applications and protocols. It is often put in contrast to RSA based",
"sections": [
"intro",
"usage",
"introduction",
"api",
"compatibilty",
"license"
],
"hasApi": true,
"hasExamples": true,
"exampleCount": 4,
"examples": [
"`sodium-native` ships with prebuilds for macOS, Windows, and Linux.\n\nNote that the module itself is generated on a prepublish hook.\n\n## Usage",
"Works seamlessly with Node.js:",
"And the browser:\n\nFirst install the peer dep, `sodium-javascript`."
]
},
"patterns": [
"cryptography"
]
}