Skip to content

Swap out Buffer with browser-compatible Uint8Array - #83

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

Mrtenz merged 3 commits into
mainfrom
mrtenz/remove-buffer

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Oct 12, 2022

Copy link
Copy Markdown
Member

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 thread src/SLIP10Node.ts Resolved
Comment thread src/curves/curve.ts Resolved
Comment thread src/derivers/bip32.ts Resolved
Comment thread src/derivers/bip32.ts Resolved
Comment thread src/utils.test.ts Resolved
Comment thread src/SLIP10Node.ts
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;

@rekmarks rekmarks Oct 18, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

Comment thread src/extended-keys.ts Resolved
Comment thread src/utils.ts Resolved

@rekmarks rekmarks left a comment

Copy link
Copy Markdown
Contributor

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.

@rekmarks rekmarks left a comment

Copy link
Copy Markdown
Contributor

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