react-native-google-safetynet icon indicating copy to clipboard operation
react-native-google-safetynet copied to clipboard

Why Base64.decode for stringToBytes ?

Open sayoojvalsan opened this issue 3 years ago • 0 comments

private byte[] stringToBytes(String string) { byte[] bytes; bytes = null; try { bytes = Base64.decode(string, Base64.DEFAULT); } catch(IllegalArgumentException e) { e.printStackTrace(); } return bytes; }

Shouldn't this be - byte[] b = string.getBytes(); byte[] b = string.getBytes(Charset.forName("UTF-8")); byte[] b = string.getBytes(StandardCharsets.UTF_8); // Java 7+ only

Also shouldn't it be encode ? why decode ?

sayoojvalsan avatar Jul 23 '21 08:07 sayoojvalsan