@decryption/base 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/esm/index.js +1056 -0
- package/index.d.ts +555 -0
- package/index.js +1062 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @decryption/base
|
|
2
|
+
|
|
3
|
+
> **NOTE:** This is a fork of [`@scure/base`](https://www.npmjs.com/package/@scure/base) (v2.2.0).
|
|
4
|
+
> We dual-publish as both **CJS and ESM** because upstream is ESM-only (`"type": "module"`), which breaks
|
|
5
|
+
> `require()` in Jest, older bundlers and CJS-based Node.js tooling. The source is unchanged from upstream —
|
|
6
|
+
> only the build tooling differs, plus `@noble/*` / `@scure/*` import specifiers are rewritten to their
|
|
7
|
+
> `@decryption/*` forks.
|
|
8
|
+
|
|
9
|
+
Audited & minimal 0-dependency implementation of bech32, base64, base58, base32 & base16. Dual CJS+ESM fork of @scure/base.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @decryption/base
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Import submodules directly — `dist/` is the package root once published, so deep imports work in both CJS and ESM:
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { sha256 } from '@decryption/hashes/sha2';
|
|
23
|
+
import { xchacha20poly1305 } from '@decryption/ciphers/chacha';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Refer to the [upstream documentation](https://github.com/paulmillr/base) for the full API.
|
|
27
|
+
|
|
28
|
+
## Syncing upstream
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
./scripts/vendor-fork.sh @scure/base <version> base
|
|
32
|
+
node scripts/fix-imports.js packages/base base
|
|
33
|
+
pnpm --filter @decryption/base build && pnpm --filter @decryption/base test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT — Copyright (c) 2022 Paul Miller (https://paulmillr.com). See [LICENSE](./LICENSE).
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
### Setup
|
|
45
|
+
|
|
46
|
+
1. Clone the repository:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/constructive-io/decryption.git
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. Install dependencies:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cd decryption
|
|
56
|
+
pnpm install
|
|
57
|
+
pnpm build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. Test the package of interest:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cd packages/<packagename>
|
|
64
|
+
pnpm test:watch
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Credits
|
|
68
|
+
|
|
69
|
+
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
|
|
70
|
+
|
|
71
|
+
## Disclaimer
|
|
72
|
+
|
|
73
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
74
|
+
|
|
75
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|