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

Base types #20

Merged
merged 1 commit into from
Sep 19, 2022
Merged

Base types #20

merged 1 commit into from
Sep 19, 2022

Conversation

boterop
Copy link
Contributor

@boterop boterop commented Sep 17, 2022

Description

Fixes #11

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@boterop boterop linked an issue Sep 17, 2022 that may be closed by this pull request
4 tasks
@boterop boterop changed the title Add base types (spec and structs) Base types Sep 17, 2022
@boterop boterop force-pushed the 11-base-types branch 2 times, most recently from 140b7f2 to 6a2fa60 Compare September 19, 2022 15:16
Copy link
Contributor

@juanhurtado10 juanhurtado10 left a comment

Choose a reason for hiding this comment

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

@santiagoboterokommit Uint8Array is similar to an Array where each item is an 8-bit (1 byte) unsigned integer. Uint8Arrays cannot change size after creation (this is not a problem since the elixir struct does not mutate).

That said, your structure could receive two types of data:

  1. A list of positive integers.
  2. A binary buffer that must be read from left to right every 1 byte and thus obtain the unsigned integer.

Note: be sure to handle the binary offset correctly.

juanhurtado10
juanhurtado10 previously approved these changes Sep 19, 2022
Copy link
Contributor

@juanhurtado10 juanhurtado10 left a comment

Choose a reason for hiding this comment

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

@santiagoboterokommit well job done 💪 !

@boterop boterop merged commit b0c2a65 into v0.1 Sep 19, 2022
@boterop boterop deleted the 11-base-types branch September 19, 2022 22:04
miguelnietoa pushed a commit that referenced this pull request Oct 11, 2022
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.

Base types
2 participants