# base2base

> A node.js typescript function to convert any string/number, from & to all the bases ranging between 2-36 and base64.

Latest version **1.1.0** (published 2023-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install base2base
pnpm add base2base
yarn add base2base
bun add base2base
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-09-04 |
| First published | 2023-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | zWolfrost |
| Maintainers | zwolfrost |
| Keywords | base, convert, node, nodejs |

## Links

- npm: https://www.npmjs.com/package/base2base
- Repository: https://github.com/zWolfrost/base2base
- Homepage: https://github.com/zWolfrost/base2base#readme
- Issues: https://github.com/zWolfrost/base2base/issues
- npm.io page: https://npm.io/package/base2base

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2023-09-04
- 1.0.1 — 2023-08-31
- 1.0.0 — 2023-08-31

## README

# base2base
A node.js typescript function to convert any string/number, **from** & **to** all the bases ranging between 2-36 **and** base64.

&nbsp;
## How to use
```js
const base2base = require("base2base")


let binary = base2base(314159, {to: 2})
console.log(binary)
// "1001100101100101111"

let hex = base2base(binary, {from: 2, to: 16})
console.log(hex)
// "4cb2f"

let base64 = base2base(hex, {to: 64})
console.log(base64)
// "NGNiMmY="

let hexDecoded = base2base(base64, {from: 64})
console.log(hexDecoded)
// "4cb2f"


let invalidBinary = base2base("1010ab", {from: 2, to: 2})
console.log(invalidBinary)
// "1010"

let invalidBinaryStrict = base2base("1010ab", {from: 2, to: 2, strict: true})
console.log(invalidBinaryStrict)
// NaN
```

&nbsp;
## Changelog & Breaking Changes

- **v1.0.0**
<br>- First commit.
  - v1.0.1
  <br>- Fixed bug where Intellisense wouldn't work.
- **v1.1.0**
<br>- Added strict mode for base64 as well.

&nbsp;
## Found a bug and/or need help?
Please [open an issue](https://github.com/zWolfrost/base2base/issues) on GitHub to request a change, report a bug or ask for help about something and i will gladly look into it.

If you like this library, consider giving it a star on [GitHub](https://github.com/zWolfrost/base2base). It means a lot :)

---
_Source: https://npm.io/package/base2base · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
