check buffering events ()

* 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:
Akinwale Ariwodola 2020-07-21 19:30:45 +01:00 committed by GitHub
parent 481c50f465
commit c772cf2ead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 104 additions and 0 deletions
app/src/main/java/io/lbry/browser/utils

View file

@ -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;
}
}
}