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

Add bytes function to IPAddress #336

Closed
05nelsonm opened this issue Jan 28, 2024 · 3 comments · Fixed by #431
Closed

Add bytes function to IPAddress #336

05nelsonm opened this issue Jan 28, 2024 · 3 comments · Fixed by #431
Milestone

Comments

@05nelsonm
Copy link
Owner

  • Add ByteArray.toIPAddress
  • Add ByteArray.toIPAddressOrNull
  • Add ByteArray.toIPAddressV4
  • Add ByteArray.toIPAddressV4OrNull
  • Add ByteArray.toIPAddressV6
  • Add ByteArray.toIPAddressV6OrNull

Within the IPAddress sealed class a bytes() function should be available which would produce a copy of the private field ByteArray.

@05nelsonm 05nelsonm added this to the 2.0.0-alpha01 milestone Jan 28, 2024
@05nelsonm
Copy link
Owner Author

This will also allow for expansion of the IPv6 addresses in order to produce uniformity such that the Address.value is always the same. Might even want to lift the final override for equals & hashCode such that IPAddress implementation can compare the underlying byte field.

@05nelsonm
Copy link
Owner Author

Also will be able to add Jvm extension functions for toInetAddress using InetAddress.getByAddress

@05nelsonm
Copy link
Owner Author

05nelsonm commented May 28, 2024

Will do this in future 2.x.0 release

Edit: needed for implementing TorCmd.MapAddress

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 a pull request may close this issue.

1 participant