init
This commit is contained in:
21
node_modules/bs58/LICENSE
generated
vendored
Normal file
21
node_modules/bs58/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 cryptocoinjs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
91
node_modules/bs58/README.md
generated
vendored
Normal file
91
node_modules/bs58/README.md
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
bs58
|
||||
====
|
||||
|
||||
[](https://travis-ci.org/cryptocoinjs/bs58)
|
||||
|
||||
JavaScript component to compute base 58 encoding. This encoding is typically used for crypto currencies such as Bitcoin.
|
||||
|
||||
**Note:** If you're looking for **base 58 check** encoding, see: [https://github.com/bitcoinjs/bs58check](https://github.com/bitcoinjs/bs58check), which depends upon this library.
|
||||
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
npm i --save bs58
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
### encode(input)
|
||||
|
||||
`input` must be a `Uint8Array`, `Buffer`, or an `Array`. It returns a `string`.
|
||||
|
||||
**example**:
|
||||
|
||||
```js
|
||||
import bs58 from 'bs58'
|
||||
|
||||
const bytes = Uint8Array.from([
|
||||
0, 60, 23, 110, 101, 155, 234,
|
||||
15, 41, 163, 233, 191, 120, 128,
|
||||
193, 18, 177, 179, 27, 77, 200,
|
||||
38, 38, 129, 135
|
||||
])
|
||||
const address = bs58.encode(bytes)
|
||||
console.log(address)
|
||||
// => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS
|
||||
```
|
||||
|
||||
|
||||
### decode(input)
|
||||
|
||||
`input` must be a base 58 encoded string. Returns a Uint8Array.
|
||||
|
||||
**example**:
|
||||
|
||||
```js
|
||||
import bs58 from 'bs58'
|
||||
|
||||
const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS'
|
||||
const bytes = bs58.decode(address)
|
||||
// See uint8array-tools package for helpful hex encoding/decoding/compare tools
|
||||
console.log(Buffer.from(bytes).toString('hex'))
|
||||
// => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187
|
||||
```
|
||||
|
||||
Browser
|
||||
-----------
|
||||
You can use this module in the browser. Install Browserify:
|
||||
|
||||
```bash
|
||||
npm install -g browserify
|
||||
```
|
||||
|
||||
then run:
|
||||
|
||||
```bash
|
||||
browserify node_modules/bs58/cjs/index.cjs -o bs58.bundle.js --standalone bs58
|
||||
```
|
||||
|
||||
Hack / Test
|
||||
-----------
|
||||
|
||||
Uses JavaScript standard style. Read more:
|
||||
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
|
||||
Credits
|
||||
-------
|
||||
- [Mike Hearn](https://github.com/mikehearn) for original Java implementation
|
||||
- [Stefan Thomas](https://github.com/justmoon) for porting to JavaScript
|
||||
- [Stephan Pair](https://github.com/gasteve) for buffer improvements
|
||||
- [Daniel Cousens](https://github.com/dcousens) for cleanup and merging improvements from bitcoinjs-lib
|
||||
- [Jared Deckard](https://github.com/deckar01) for killing `bigi` as a dependency
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
MIT
|
||||
54
node_modules/bs58/package.json
generated
vendored
Normal file
54
node_modules/bs58/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "bs58",
|
||||
"version": "6.0.0",
|
||||
"type": "module",
|
||||
"description": "Base 58 encoding / decoding",
|
||||
"keywords": [
|
||||
"base58",
|
||||
"bitcoin",
|
||||
"crypto",
|
||||
"crytography",
|
||||
"decode",
|
||||
"decoding",
|
||||
"encode",
|
||||
"encoding",
|
||||
"litecoin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.8",
|
||||
"rimraf": "^5.0.7",
|
||||
"tape": "^5.3.0",
|
||||
"ts-standard": "^12.0.2",
|
||||
"typescript": "^5.5.2"
|
||||
},
|
||||
"repository": {
|
||||
"url": "https://github.com/cryptocoinjs/bs58",
|
||||
"type": "git"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"main": "src/cjs/index.cjs",
|
||||
"module": "src/esm/index.js",
|
||||
"types": "src/cjs/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./src/esm/index.js",
|
||||
"require": "./src/cjs/index.cjs",
|
||||
"types": "./src/cjs/index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json",
|
||||
"clean": "rimraf src",
|
||||
"gitdiff": "npm run build && git diff --exit-code",
|
||||
"postbuild": "find src/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\;",
|
||||
"standard": "ts-standard --ignore src --ignore test",
|
||||
"test": "npm run standard && npm run unit",
|
||||
"unit": "tape test/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"base-x": "^5.0.0"
|
||||
}
|
||||
}
|
||||
8
node_modules/bs58/src/cjs/index.cjs
generated
vendored
Normal file
8
node_modules/bs58/src/cjs/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var base_x_1 = __importDefault(require("base-x"));
|
||||
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
||||
exports.default = (0, base_x_1.default)(ALPHABET);
|
||||
3
node_modules/bs58/src/cjs/index.d.ts
generated
vendored
Normal file
3
node_modules/bs58/src/cjs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import basex from 'base-x';
|
||||
declare const _default: basex.BaseConverter;
|
||||
export default _default;
|
||||
3
node_modules/bs58/src/esm/index.js
generated
vendored
Normal file
3
node_modules/bs58/src/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import basex from 'base-x';
|
||||
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
||||
export default basex(ALPHABET);
|
||||
Reference in New Issue
Block a user