Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dchest/tweetnacl-auth-js
HMAC-SHA-512-256 for TweetNacl.js
https://github.com/dchest/tweetnacl-auth-js
Last synced: 23 days ago
JSON representation
HMAC-SHA-512-256 for TweetNacl.js
- Host: GitHub
- URL: https://github.com/dchest/tweetnacl-auth-js
- Owner: dchest
- License: unlicense
- Created: 2014-07-30T14:34:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T15:22:39.000Z (over 6 years ago)
- Last Synced: 2024-10-14T01:48:12.037Z (about 1 month ago)
- Language: JavaScript
- Size: 922 KB
- Stars: 21
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
HMAC-SHA-512-256 for TweetNacl.js
=================================Implementation of
(requires [TweetNaCl.js](https://github.com/dchest/tweetnacl-js)).Written in 2014 by Dmitry Chestnykh. Public domain.
[![Build Status](https://travis-ci.org/dchest/tweetnacl-auth-js.svg?branch=master)
](https://travis-ci.org/dchest/tweetnacl-auth-js)Installation
------------Via NPM:
$ npm install tweetnacl-auth
or just download `nacl-auth.js` or `nacl-auth.min.js` and include it after
TweetNaCl.js:```html
```
If using a CommonJS environment, such as Node.js, you can import it into `nacl`
namespace:```javascript
var nacl = require('tweetnacl');
nacl.auth = require('tweetnacl-auth');
```Usage
-----### nacl.auth(message, key)
Authenticates the given message with the secret key.
(In other words, returns HMAC-SHA-512-256 of the message under the key.)### nacl.auth.full(message, key)
Returns HMAC-SHA-512 (without truncation) of the message under the key
### nacl.auth.authLength = 32
Length of authenticator returned by `nacl.auth`.
### nacl.auth.authFullLength = 64
Length of authenticator returned by `nacl.auth.full`.
### nacl.auth.keyLength = 32
Length of key for `nacl.auth` and `nacl.auth.full` (key length is currently not
enforced).