Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up encoding module, part 2 #3617

Closed
Tracked by #3489
kt3k opened this issue Sep 4, 2023 · 2 comments
Closed
Tracked by #3489

Clean up encoding module, part 2 #3617

kt3k opened this issue Sep 4, 2023 · 2 comments

Comments

@kt3k
Copy link
Member

kt3k commented Sep 4, 2023

encoding module has the following encodings and corresponding decode and encode methods:

  • ascii85
    • encode: Uint8Array -> string
    • decode: string -> Uint8Array
  • base32
    • encode: Uint8Array -> string
    • decode: string -> Uint8Array
  • base58
    • encode: ArrayBuffer | string -> string
    • decode: string -> Uint8Array
  • base64
    • encode: ArrayBuffer | string -> string
    • decode: string -> Uint8Array
  • base64url
    • encode: ArrayBuffer | string -> string
    • decode: string -> Uint8Array
  • hex
    • encode: Uint8Array -> Uint8Array
    • decode: Uint8Array -> Uint8Array
  • varint
    • encode: bigint | number -> [Uint8Array, number]
    • decode: Uint8Array -> [bigint, number]

Encodings except varint are similar in typing, but there are discrepancies (The case of hex is pointed in #3605). I think these 6 encodings should have the same typings, for example encode: Uint8Array | ArrayBuffer | string -> string; decode: string -> Uint8Array

part of #3489

@kt3k kt3k mentioned this issue Sep 4, 2023
16 tasks
@kt3k kt3k changed the title Clean up encoding module Clean up encoding module 2 Sep 4, 2023
@kt3k kt3k changed the title Clean up encoding module 2 Clean up encoding module, part 2 Sep 4, 2023
@lino-levan
Copy link
Contributor

@kt3k is this completed?

@kt3k
Copy link
Member Author

kt3k commented Sep 29, 2023

@lino-levan Yeah, let's close this. Thanks for your contributions!

@kt3k kt3k closed this as completed Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants