# convert-string

> Convert to/from strings and array of bytes

Latest version **0.1.0** (published 2013-11-21) · 0 weekly downloads

## Install

```sh
npm install convert-string
pnpm add convert-string
yarn add convert-string
bun add convert-string
```

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-11-21 |
| First published | 2013-11-21 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/convert-string) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jp |
| Keywords | string, strings, convert, hex, bytes |

## Links

- npm: https://www.npmjs.com/package/convert-string
- Repository: https://github.com/cryptocoinjs/convert-string
- Issues: https://github.com/cryptocoinjs/convert-string/issues
- npm.io page: https://npm.io/package/convert-string

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2013-11-21

## README

convert-string
==============

JavaScript component to convert to/from strings and byte arrays.

AMD/CommonJS compatible.


Install
-------

### Node.js/Browserify

    npm install --save convert-string


### Component

    component install cryptocoin/convert-string


### Bower

    bower install convert-string


### Script

```html
<script src="/path/to/convert-string.js"></script>
```


Usage
-----

### stringToBytes(str)

### bytesToString(bytes)

### UTF8.stringToBytes(str)

### UTF8.bytesToString(bytes)


Credits
-------

Loosely inspired by code from here: https://github.com/vbuterin/bitcoinjs-lib & CryptoJS


References on JavaScript UTF-8 forced encoding
----------------------------------------------

(these sources are also included as PDFs in the repo in case the links go dead)

- http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html
- http://hossa.in/2012/07/20/utf-8-in-javascript.html



License
-------

(MIT License)

Copyright 2013, JP Richardson  <jprichardson@gmail.com>

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