Skip to content

Commit

Permalink
Merge pull request #79 from xcelr8/main
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
Hexagon committed Sep 16, 2022
2 parents 88b4706 + 3ef215e commit 8dec1e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<p align="center">
<img src="https://cdn.jsdelivr.net/gh/hexagon/base64@main/base64.png" alt="@hexagon/base64" width="200" height="200"><br>
<br>Probably the only JavaScript base64 library you'll ever need.<br>
<br>Probably the only JavaScript base64 library you'll ever need!<br>
</p>

# @hexagon/base64

Encode, decode and validate base64 and base64url to string or arraybuffer, and back. Works in Node, Deno or browser.
Encode, decode and validate base64/base64url to string/arraybuffer and vice-versa. Works in Node, Deno and browser.

[![Node.js CI](https://github.com/Hexagon/base64/actions/workflows/node.js.yml/badge.svg)](https://github.com/Hexagon/base64/actions/workflows/node.js.yml) [![Deno CI](https://github.com/Hexagon/base64/actions/workflows/deno.yml/badge.svg)](https://github.com/Hexagon/base64/actions/workflows/deno.yml)
[![npm version](https://badge.fury.io/js/@hexagon%2Fbase64.svg)](https://badge.fury.io/js/@hexagon%2Fbase64) [![NPM Downloads](https://img.shields.io/npm/dm/@hexagon/base64.svg)](https://www.npmjs.org/package/@hexagon/base64) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/@hexagon/base64/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@hexagon/base64) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4978bdbf495941c087ecb32b120f28ff)](https://www.codacy.com/gh/Hexagon/base64/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Hexagon/base64&amp;utm_campaign=Badge_Grade)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hexagon/base64/blob/master/LICENSE)

* Supports regular base64, as well as base64url
* Supports regular base64 and base64url
* Convert to/from string or arraybuffer
* Validate / identify base64 and base64url
* Works in Node.js >=4.0 (both require and import).
Expand Down Expand Up @@ -79,7 +79,7 @@ To use as a [UMD](https://github.com/umdjs/umd)-module (stand alone, [RequireJS]
<script src="https://cdn.jsdelivr.net/npm/@hexagon/base64@1/dist/base64.min.js"></script>
```

To use as a [ES-module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
To use as an [ES-module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)

```html
<script type="module">
Expand Down Expand Up @@ -136,12 +136,12 @@ console.log(example5valid);

### Full API

The library encodes and decodes base64/base64url to and from ArrayBuffers
The library encodes and decodes base64/base64url to ArrayBuffers and vice-versa

- __fromArrayBuffer(buffer, urlMode)__ - Encodes `ArrayBuffer` into base64 or base64url if urlMode (optional) is true
- __fromArrayBuffer(buffer, urlMode)__ - Encodes `ArrayBuffer` into base64 or base64url if urlMode(optional) is true
- __toArrayBuffer(str, urlMode)__ - Decodes base64url string (or base64url string if urlMode is true) to `ArrayBuffer`

- __fromString(str, urlMode)__ - Encodes `String` into base64 string (or base64url string if urlMode is true)
- __fromString(str, urlMode)__ - Encodes `String` into base64 string(base64url string if urlMode is true)
- __toString(str, urlMode)__ - Decodes base64 or base64url string to `String`

- __validate(str, urlMode)__ - Returns true if `String` str is valid base64/base64 dependending on urlMode
Expand Down

0 comments on commit 8dec1e5

Please sign in to comment.