Merge branch 'bluetooth-refactoring' into 'master'

Factor shared Bluetooth code into superclass

Closes #831

See merge request akwizgran/briar!662
This commit is contained in:
akwizgran
2018-01-17 11:11:20 +00:00
11 changed files with 471 additions and 615 deletions

View File

@@ -126,6 +126,10 @@ public class StringUtils {
return toUtf8(s).length > maxLength;
}
public static boolean isValidMac(String mac) {
return MAC.matcher(mac).matches();
}
public static byte[] macToBytes(String mac) {
if (!MAC.matcher(mac).matches()) throw new IllegalArgumentException();
return fromHexString(mac.replaceAll(":", ""));