Package com.restfb.util
Klasse EncodingUtils
java.lang.Object
com.restfb.util.EncodingUtils
A collection of data-encoding utility methods.
- Seit:
- 1.6.13
- Autor:
- Josef Gierbl, Mikael Grev, Mark Allen
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic byte[]
decodeBase64
(String base64) Decodes a base64-encoded string, padding out if necessary.static String
encodeAppSecretProof
(String appSecret, String accessToken) Generates an appsecret_proof for facebook.static byte[]
encodeHex
(byte[] data) Encodes a hexbyte[]
from givenbyte[]
.
-
Methodendetails
-
decodeBase64
Decodes a base64-encoded string, padding out if necessary.- Parameter:
base64
- The base64-encoded string to decode.- Gibt zurück:
- A decoded version of
base64
. - Löst aus:
NullPointerException
- Ifbase64
isnull
.
-
encodeHex
Encodes a hexbyte[]
from givenbyte[]
. This function is equivalent to Apache commons-codec binarynew Hex().encode(byte[])
- Parameter:
data
- The data to encode as hex.- Gibt zurück:
- Hex-encoded
byte[]
- Löst aus:
NullPointerException
- Ifdata
isnull
.
-
encodeAppSecretProof
Generates an appsecret_proof for facebook. See https://developers.facebook.com/docs/graph-api/securing-requests for more info- Parameter:
appSecret
- The facebook application secretaccessToken
- The facebook access token- Gibt zurück:
- A Hex encoded SHA256 Hash as a String
-