Package io.realm.transformer
Class Utils
- java.lang.Object
-
- io.realm.transformer.Utils
-
public class Utils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringbase64Encode(java.lang.String data)Encode the given string with Base64static java.lang.StringhexStringify(byte[] data)Convert a byte array to its hex-stringstatic booleanisSyncEnabled(org.gradle.api.Project project)static byte[]sha256Hash(byte[] data)Compute the SHA-256 hash of the given byte array
-
-
-
Method Detail
-
base64Encode
public static java.lang.String base64Encode(java.lang.String data) throws java.io.UnsupportedEncodingExceptionEncode the given string with Base64- Parameters:
data- the string to encode- Returns:
- the encoded string
- Throws:
java.io.UnsupportedEncodingException- if string is not valid utf8
-
sha256Hash
public static byte[] sha256Hash(byte[] data) throws java.security.NoSuchAlgorithmExceptionCompute the SHA-256 hash of the given byte array- Parameters:
data- the byte array to hash- Returns:
- the hashed byte array
- Throws:
java.security.NoSuchAlgorithmException
-
hexStringify
public static java.lang.String hexStringify(byte[] data)
Convert a byte array to its hex-string- Parameters:
data- the byte array to convert- Returns:
- the hex-string of the byte array
-
isSyncEnabled
public static boolean isSyncEnabled(org.gradle.api.Project project)
-
-