Skip to content

Commit

Permalink
Add base32nopad and base32hexnopad
Browse files Browse the repository at this point in the history
  • Loading branch information
benjreinhart committed May 29, 2024
1 parent 66cd490 commit a131a61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ import { base16, base32, base64, base58 } from '@scure/base';
import {
base58xmr,
base58xrp,
base32nopad,
base32hex,
base32hexnopad,
base32crockford,
base64nopad,
base64url,
Expand Down
10 changes: 10 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,22 @@ export const base32: BytesCoder = /* @__PURE__ */ chain(
padding(5),
join('')
);
export const base32nopad: BytesCoder = /* @__PURE__ */ chain(
radix2(5),
alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'),
join('')
);
export const base32hex: BytesCoder = /* @__PURE__ */ chain(
radix2(5),
alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'),
padding(5),
join('')
);
export const base32hexnopad: BytesCoder = /* @__PURE__ */ chain(
radix2(5),
alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'),
join('')
);
export const base32crockford: BytesCoder = /* @__PURE__ */ chain(
radix2(5),
alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'),
Expand Down

0 comments on commit a131a61

Please sign in to comment.