-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update dependency @types/node to v22 (#233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Witter <[email protected]>
- Loading branch information
1 parent
0e319d1
commit 5648373
Showing
6 changed files
with
29 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { base58 } from "@scure/base" | ||
export function toBase58(data: Uint8Array | Buffer | Number[]): string { | ||
const a = Buffer.from(data) | ||
return base58.encode(Uint8Array.from(a)) | ||
import { base58 } from '@scure/base'; | ||
|
||
export function toBase58(data: Uint8Array | Buffer | number[]): string { | ||
return base58.encode(Uint8Array.from(data)); | ||
} | ||
|
||
export function fromBase58(data: string): Uint8Array { | ||
return base58.decode(data) | ||
return base58.decode(data); | ||
} | ||
|
||
export {base58} | ||
export { base58 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import {sha256} from "./hash"; | ||
import { sha256 } from './hash'; | ||
import { base58check } from '@scure/base'; | ||
|
||
const createHash = require("create-hash") | ||
|
||
import { base58check } from "@scure/base" | ||
|
||
export function toBase58Check(data: Uint8Array | Buffer | Number[]): string { | ||
const bytesCoder = base58check(sha256); | ||
return bytesCoder.encode(Buffer.from(data)) | ||
export function toBase58Check(data: Uint8Array | Buffer | number[]): string { | ||
const bytesCoder = base58check(sha256); | ||
return bytesCoder.encode(Uint8Array.from(data)); | ||
} | ||
|
||
export function fromBase58Check(data: string): Buffer { | ||
const bytesCoder = base58check(sha256); | ||
return Buffer.from(bytesCoder.decode(data)) | ||
} | ||
const bytesCoder = base58check(sha256); | ||
return Buffer.from(bytesCoder.decode(data)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { base64 } from "@scure/base" | ||
import { base64 } from '@scure/base'; | ||
|
||
export function toBase64(data: Uint8Array | Buffer | Number[]): string { | ||
const a = Buffer.from(data) | ||
return base64.encode(Uint8Array.from(a)) | ||
export function toBase64(data: Uint8Array | Buffer | number[]): string { | ||
return base64.encode(Uint8Array.from(data)); | ||
} | ||
|
||
export function fromBase64(data: string): Uint8Array { | ||
return base64.decode(data) | ||
} | ||
return base64.decode(data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import {bech32} from "@scure/base"; | ||
import { bech32 } from '@scure/base'; | ||
|
||
export function toBech32(prefix: string, data: Buffer | Uint8Array | Number[], limit?: number | false): string { | ||
const a = Buffer.from(data) | ||
const bit5 = bech32.toWords(Uint8Array.from(a)) | ||
return bech32.encode(prefix, bit5, limit) | ||
export function toBech32(prefix: string, data: Buffer | Uint8Array | number[], limit?: number | false): string { | ||
const bit5 = bech32.toWords(Uint8Array.from(data)); | ||
return bech32.encode(prefix, bit5, limit); | ||
} | ||
|
||
export function fromBech32(data: string, limit?: number | false): [string, Buffer] { | ||
const d = bech32.decode(data, limit) | ||
const bit8 = bech32.fromWords(d.words) | ||
return [d.prefix, Buffer.from(bit8)] | ||
const d = bech32.decode(data, limit); | ||
const bit8 = bech32.fromWords(d.words); | ||
return [d.prefix, Buffer.from(bit8)]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters