Skip to content

Swap out Buffer with browser-compatible Uint8Array#83

Merged
Mrtenz merged 3 commits intomainfrom
mrtenz/remove-buffer
Oct 24, 2022
Merged

Swap out Buffer with browser-compatible Uint8Array#83
Mrtenz merged 3 commits intomainfrom
mrtenz/remove-buffer

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Oct 12, 2022

Buffer is a Node.js API and does not work in browsers without polyfills. This swaps out all usage of Buffer with Uint8Array, to make this library fully browser compatible without the need for polyfills.

@Mrtenz Mrtenz requested a review from a team as a code owner October 12, 2022 09:07
Comment on lines +254 to +258
public readonly chainCodeBuffer: Uint8Array;

public readonly privateKeyBuffer?: Buffer;
public readonly privateKeyBuffer?: Uint8Array;

public readonly publicKeyBuffer: Buffer;
public readonly publicKeyBuffer: Uint8Array;
Copy link
Member

@rekmarks rekmarks Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will be breaking. Should we rename these properties to *Bytes instead of *Buffer instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're gonna do this in a follow-up.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to my inline comment(s), there are some questions by @FrederikBolding that should be resolved before we merge this.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Mrtenz Mrtenz merged commit 3da3c2b into main Oct 24, 2022
@Mrtenz Mrtenz deleted the mrtenz/remove-buffer branch October 24, 2022 07:26
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

Successfully merging this pull request may close these issues.

3 participants