open-index/open-npm huggingface dataset:
npm package: @juanelas/aes-gcm
Description: Easy to use aes-gcm cipher for node.js and browser.
Author: Juan Hernández Serrano
Latest version: 1.1.0

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Node.js CI](https://github.com/juanelas/aes-gcm/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/juanelas/aes-gcm/actions/workflows/build-and-test.yml)

# @juanelas/aes-gcm

Easy to use aes-gcm cipher for node.js and browser.

In order to facilitate ciphertext exchange (encrypted data and IV), the generated ciphertext object (obtained after encrypting) can be JSON.stringified. The decrypt method accept as well the JSON version of the ciphertext.

## Install

```console
npm install @juanelas/aes-gcm
```

## Usage

Either require (Node.js CJS):

```javascript
const aesGcm = require('@juanelas/aes-gcm')
```

or import (TypeScript or JavaScript ES module):

```javascript
import * as aesGcm from '@juanelas/aes-gcm'
```

An example code for encryption and decryption could be:

```typescript
const key = await aesGcm.generateKey(256, false) // create a non-extractable random key of 256 bits

const mStr = 'my-plaintext-msg'
const m = (new TextEncoder()).encode(mStr) // convert to buffer

// encrypt m with key
const c = await aesGcm.encrypt(m, key)

// decrypt c with key
const d = await aesGcm.decrypt(c, key)
const dStr = (new TextDecoder()).decode(d) // convert back to utf-8 string 'my-plaintext-msg'

// to ease ciphertext exchange, you could JSON.stringify it
const cStr = JSON.stringify(c)

 // The JSON.stringified ciphertext can as well be directly decrypted
const d = await aesGcm.decrypt(cStr, key)
const dStr = (new TextDecoder()).decode(d) // convert back to utf-8 string 'my-plaintext-msg'

// If needed, you could recover the Ciphertext object (with iv and encrypted) from cStr
const c2 = aesGcm.Ciphertext.fromJSON(cStr)

```

## API reference documentation

[Check the API](docs/API.md)
npm package: @juanelas/base64
Description: Base64 for both node.js and browser javascript. It supports URL-safe encoding and enabling/disabling padding. Buffers can be implementedd using ArrayBuffer, any TypedArray, or Buffer
Author: Juan Hernández Serrano
Latest version: 1.1.5

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Node.js CI](https://github.com/juanelas/base64/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/juanelas/base64/actions/workflows/build-and-test.yml)
[![Coverage Status](https://coveralls.io/repos/github/juanelas/base64/badge.svg?branch=main)](https://coveralls.io/github/juanelas/base64?branch=main)

# @juanelas/base64

Base64 for both node.js and browser javascript. It supports URL-safe encoding and enabling/disabling padding. Buffers can be implementedd using ArrayBuffer, any TypedArray, or Buffer.

## Usage

`@juanelas/base64` can be imported to your project with `npm`:

```console
npm install @juanelas/base64
```

Then either require (Node.js CJS):

```javascript
const base64 = require('@juanelas/base64')
```

or import (JavaScript ES module):

```javascript
import * as base64 from '@juanelas/base64'
```

The appropriate version for browser or node is automatically exported. Types for TypeScript users are also provided.

You can also download the [IIFE bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/bundle.iife.js), the [ESM bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/esm/bundle.min.js) or the [UMD bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/bundle.umd.js) and manually add it to your project, or, if you have already installed `@juanelas/base64` in your project, just get the bundles from `node_modules/@juanelas/base64/dist/bundles/`.

An example of usage could be:

```typescript
import * as base64 from '@juanelas/base64'

const buf = new Uint8Array([254, 1, 128, 255])
const base64str = base64.encode(buf, true, false) // URL-safe base64 with no padding

console.log(base64str) // Outputs: '_gGA_w'

const buf2 = base64.decode(base64str) // URL-safe encoding and padding are automatically detected

console.log(buf2.toString()) // Outputs: '254,1,128,255'

const text = 'fooba'
const base64str2 = base64.encode(text) // Standard base64 with padding

console.log(base64str2) // Outputs: 'Zm9vYmE='

const text2 = base64.decode(base64str2, true) // Output to unicode string instead of Uint8Array

console.log(text2) // Outputs: 'fooba'

```

## API reference documentation

[Check the API](./docs/API.md)
npm package: @juanfabrega/dialog
Description: Accessible React Modal Dialog.
Author: React Training
Latest version: 0.16.3

# @reach/dialog

[![Stable release](https://img.shields.io/npm/v/@reach/dialog.svg)](https://npm.im/@reach/dialog) ![MIT license](https://badgen.now.sh/badge/license/MIT)

[Docs](https://reach.tech/dialog) | [Source](https://github.com/reach/reach-ui/tree/main/packages/dialog) | [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/#dialog_modal)

An accessible dialog or modal window.

```jsx
import { Dialog } from "@reach/dialog";
import "@reach/dialog/styles.css";

function Example(props) {
  const [showDialog, setShowDialog] = React.useState(false);
  const open = () => setShowDialog(true);
  const close = () => setShowDialog(false);

  return (
    <div>
      <button onClick={open}>Open Dialog</button>
      <Dialog isOpen={showDialog} onDismiss={close}>
        <button className="close-button" onClick={close}>
          <VisuallyHidden>Close</VisuallyHidden>
          <span aria-hidden>×</span>
        </button>
        <p>Hello there. I am a dialog</p>
      </Dialog>
    </div>
  );
}
```