Socket
Socket
Sign inDemoInstall

poly1305-js

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    poly1305-js

Javascript implementations of Poly1305


Version published
Weekly downloads
4.7K
increased by1.4%
Maintainers
1
Install size
179 kB
Created
Weekly downloads
 

Readme

Source

Poly1305 (JavaScript)

Build Status npm version

This is a pure JavaScript implementation of Poly1305.

Installing this Library

npm install poly1305-js

Using this Library

Usage is straightforward.

const Poly1305 = require('poly1305-js');

(async function() {
    let message = Buffer.from("test message");
    let key = Buffer.from('808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f', 'hex');
    
    let tag = await Poly1305.onetimeauth(message, key);
    if (await Poly1305.onetimeauth_verify(message, key, tag)) {
        console.log('success');
    }

    // Streaming API
    let auth = new Poly1305(key);
    await auth.update(message);
    await auth.update(Buffer.from('some additional data'));
    tag = await auth.finish();
    console.log(tag);
})();

Keywords

FAQs

Last updated on 15 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc