Skip to content

Commit

Permalink
Prep v1.1.0-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Egge21M committed Aug 28, 2024
2 parents 8c5daeb + 3891035 commit 4ddc1b1
Show file tree
Hide file tree
Showing 11 changed files with 640 additions and 581 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cashu/cashu-ts",
"version": "1.1.0-1",
"version": "1.1.0-2",
"description": "cashu library for communicating with a cashu mint",
"main": "dist/lib/es5/index.js",
"module": "dist/lib/es6/index.js",
Expand Down Expand Up @@ -47,7 +47,7 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@cashu/crypto": "^0.2.6",
"@cashu/crypto": "^0.2.7",
"@noble/curves": "^1.3.0",
"@noble/hashes": "^1.3.3",
"@scure/bip32": "^1.3.3",
Expand Down
6 changes: 5 additions & 1 deletion src/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ function encodeUint8toBase64(uint8array: Uint8Array): string {
}

function encodeUint8toBase64Url(bytes: Uint8Array): string {
return Buffer.from(bytes).toString('base64url').replace(/\=+$/, '');
return Buffer.from(bytes)
.toString('base64')
.replace(/\+/g, '-') // Replace + with -
.replace(/\//g, '_') // Replace / with _
.replace(/=+$/, ''); // Remove padding characters
}

function encodeBase64toUint8(base64String: string): Uint8Array {
Expand Down
Loading

0 comments on commit 4ddc1b1

Please sign in to comment.