check buffering events (#952)
* check buffering events * use the claim permanent url for buffer events * update request parameters * hash user ids for buffer events * update buffer event endpoint
This commit is contained in:
parent
481c50f465
commit
c772cf2ead
4 changed files with 104 additions and 0 deletions
app/src/main/java/io/lbry/browser/utils
|
@ -30,6 +30,8 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.gms.common.util.Hex;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -37,6 +39,9 @@ import org.json.JSONObject;
|
|||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
@ -766,4 +771,14 @@ public final class Helper {
|
|||
}
|
||||
return id.toString();
|
||||
}
|
||||
|
||||
public static String SHA256(String value) {
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(value.getBytes("UTF-8"));
|
||||
return Hex.bytesToStringLowercase(hash);
|
||||
} catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue