Skip to content

Commit

Permalink
Rename b58c to createBase58Check for clarify. Keep old name
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Dec 10, 2023
1 parent 01ceab8 commit 70fc075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ base32hex.encode(data);
base58check is a special case: you need to pass `sha256()` function:

```js
import { base58check } from '@scure/base';
base58check(sha256).encode(data);
import { createBase58check } from '@scure/base';
createBase58check(sha256).encode(data);
```

Alternative API:
Expand Down
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,13 @@ export const base58xmr: BytesCoder = {
},
};

export const base58check = /* @__PURE__ */ (sha256: (data: Uint8Array) => Uint8Array): BytesCoder =>
export const createBase58check = /* @__PURE__ */ (sha256: (data: Uint8Array) => Uint8Array): BytesCoder =>
chain(
checksum(4, (data) => sha256(sha256(data))),
base58
);
// legacy export, bad name
export const base58check = createBase58check;

// Bech32 code
// -----------
Expand Down

0 comments on commit 70fc075

Please sign in to comment.