Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@darkwolf/base58

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@darkwolf/base58 - npm Package Compare versions

Comparing version 13.22.0 to 21.13.0

src/constants.mjs

16

package.json
{
"name": "@darkwolf/base58",
"version": "13.22.0",
"version": "21.13.0",
"description": "Base58",
"main": "index.js",
"type": "module",
"exports": {
".": "./src/index.mjs",
"./errors": "./src/errors/index.mjs",
"./constants": "./src/constants.mjs",
"./package.json": "./package.json"
},
"scripts": {

@@ -11,3 +17,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

"type": "git",
"url": "git+https://github.com/darkwolf/base58.git"
"url": "git+https://github.com/Darkwolf/base58.git"
},

@@ -23,5 +29,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/darkwolf/base58/issues"
"url": "https://github.com/Darkwolf/base58/issues"
},
"homepage": "https://github.com/darkwolf/base58#readme"
"homepage": "https://github.com/Darkwolf/base58#readme"
}
# Base58
## Install
```sh
npm i --save @darkwolf/base58
```
## Usage
`npm i --save @darkwolf/base58`
## Using
```javascript
const base58 = require('@darkwolf/base58')
const {
DARKWOLF_ALPHABET,
BITCOIN_ALPHABET,
RIPPLE_ALPHABET,
FLICKR_ALPHABET
} = require('@darkwolf/base58/constants')
const { Base58 } = base58
// default alphabet: «AveDarkwo1f23456789BCEFGHJKLMNPQRSTUVWXYZbcdghijmnpqstuxyz»
import base58, { constants } from '@darkwolf/base58'
// encode ASCII string
const encoded = base58.encode('Ave, Darkwolf!')
const decoded = base58.decode(encoded)
// encode safe integer
const encodedInt = base58.encodeInt(100000001)
const decodedInt = base58.decodeInt(encodedInt)
// custom alphabet
const btc58 = new Base58(BITCOIN_ALPHABET)
const encodedBtc = btc58.encode('Ave, Bitcoin!')
const decodedBtc = btc58.decode(encodedBtc)
const encoded = base58.encode('Ave, Darkwolf!') // HDmiyDYm3PDiZ4kmjkb
base58.decode(encoded) // 'Ave, Darkwolf!'
const encodedInteger = base58.encodeInteger(10000) // eyH
base58.decodeInteger(encodedInteger) // 10000
// Custom alphabet
const btc = base58.withAlphabet(constants.Alphabet.BITCOIN)
const encodedBtc = btc.encode('Ave, Darkwolf!') // R4qoy4gqDX4ohE7qp7i
btc.decode(encodedBtc) // 'Ave, Darkwolf!'
const encodedBtcInteger = btc.encodeInteger(10000) // 3yR
btc.decodeInteger(encodedBtcInteger) // 10000
```
## Init
### new Base58(alphabet)
## Methods
### encode(input)
### decode(input)
### encodeInt(input)
### decodeInt(input)
## [API Documentation](https://github.com/Darkwolf/base58/blob/master/docs/API.md)
## Donate
#### You can contribute to the development of open source projects by making your donation
#### Bitcoin (BTC): `15sjjAUtJdB1ncsxKK7KtyJPtF46UhXWo4`
#### Ethereum (ETH): `0xF02F68eb33E9eC73b8E9c3c0953E6782E2376867`
#### Bitcoin Cash (BCH): `qq6h3a78h3wlt04eyp9ydht94r6guzjdps9hqwgfzw`
## Contact Me
#### GitHub: [@PavelWolfDark](https://github.com/PavelWolfDark)
#### Telegram: [@PavelWolfDark](https://t.me/PavelWolfDark)
#### Email: [PavelWolfDark@gmail.com](mailto:PavelWolfDark@gmail.com)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc