Socket
Socket
Sign inDemoInstall

sodium-native

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sodium-native - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

6

package.json
{
"name": "sodium-native",
"version": "1.1.2",
"version": "1.2.0",
"description": "Low level bindings for libsodium",

@@ -9,4 +9,3 @@ "main": "index.js",

"nan": "^2.4.0",
"prebuild": "^4.4.0",
"standard": "^8.6.0"
"prebuild": "^4.4.0"
},

@@ -16,2 +15,3 @@ "devDependencies": {

"buffer-fill": "^0.1.0",
"standard": "^8.6.0",
"tape": "^4.6.3"

@@ -18,0 +18,0 @@ },

@@ -165,15 +165,2 @@ # sodium-native

### Hashing
Bindings for the crypto_hash API.
#### `crypto_hash(output, input)`
Hash an input value.
* `output` should be a buffer of length `crypto_hash_BYTES`.
* `input` should be a buffer of any length.
The generated hash is stored in `output`.
### Public / secret key box encryption

@@ -416,10 +403,10 @@

* `output` should be a buffer of any size.
* `output` should be a buffer with length within `16` - `2^32 - 1`.
* `password` should be a buffer of any size.
* `salt` should be a buffer with length `crypto_passwd_SALTBYTES`.
* `opslimit` should a be number containing your ops limit setting.
* `memlimit` should a be number containing your mem limit setting.
* `opslimit` should a be number containing your ops limit setting in the range `3` - `2^32 - 1`.
* `memlimit` should a be number containing your mem limit setting in the range `8` - `2^32 - 1`.
* `algorithm` should be a number specifying the algorithm you want to use.
Available ops and mem limits are
Available default ops and mem limits are

@@ -441,19 +428,19 @@ * `crypto_pwhash_OPSLIMIT_INTERACTIVE`

Create a password hash without a salt.
Create a password hash with a random salt.
* `output` should be a buffer of any size.
* `output` should be a buffer with length `crypto_pwhash_STRBYTES`.
* `password` should be a buffer of any size.
* `opslimit` should a be number containing your ops limit setting.
* `memlimit` should a be number containing your mem limit setting.
* `opslimit` should a be number containing your ops limit setting in the range `3` - `2^32 - 1`.
* `memlimit` should a be number containing your mem limit setting in the range `8` - `2^32 - 1`.
The generated hash will be stored in `output` and the entire `output` buffer will be used.
The generated hash, settings, salt, version and algorithm will be stored in `output` and the entire `output` buffer will be used.
#### `var bool = crypto_pwhash_str_verify(output, password)`
#### `var bool = crypto_pwhash_str_verify(str, password)`
Verify a password hash generated with the above method.
* `output` should be a buffer of any size.
* `str` should be a buffer with length `crypto_pwhash_STRBYTES`.
* `password` should be a buffer of any size.
Returns `true` if the hash could be verified. Otherwise `false`.
Returns `true` if the hash could be verified with the settings contained in `str`. Otherwise `false`.

@@ -460,0 +447,0 @@ ### Scalar multiplication

@@ -34,2 +34,6 @@ var tape = require('tape')

t.throws(function () {
sodium.crypto_pwhash_str(output, passwd)
}, 'should throw on missing args')
sodium.crypto_pwhash_str(output, passwd, opslimit, memlimit)

@@ -36,0 +40,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc