Created
April 20, 2021 10:55
-
-
Save TheIndra55/a0e4a53f1ba77d7890fe2ac95b03bbd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BytesToOctets(ipv6.GetAddressBytes()); | |
public static ushort[] BytesToOctets(byte[] bytes) | |
{ | |
var octets = new ushort[8]; | |
var j = 0; | |
for(var i = 0; i < bytes.Length; i += 2) | |
{ | |
octets[j] = (ushort)((bytes[i] << 8) | bytes[i + 1]); | |
j++; | |
} | |
return octets; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment