本文整理汇总了Java中com.facebook.internal.Utility.md5hash方法的典型用法代码示例。如果您正苦于以下问题:Java Utility.md5hash方法的具体用法?Java Utility.md5hash怎么用?Java Utility.md5hash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.internal.Utility
的用法示例。
在下文中一共展示了Utility.md5hash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCacheKeyForObjectId
import com.facebook.internal.Utility; //导入方法依赖的package包/类
private static String getCacheKeyForObjectId(String objectId) {
String accessTokenPortion = null;
AccessToken accessToken = AccessToken.getCurrentAccessToken();
if (accessToken != null) {
accessTokenPortion = accessToken.getToken();
}
if (accessTokenPortion != null) {
// Cache-key collisions are not something to worry about here, since we only store state
// for one access token. Even in the case where the previous access tokens serialized
// files have not been deleted yet, the objectSuffix will be different due to the access
// token change, thus making the key different.
accessTokenPortion = Utility.md5hash(accessTokenPortion);
}
return String.format(
Locale.ROOT,
"%s|%s|com.fb.sdk.like|%d",
objectId,
Utility.coerceValueIfNullOrEmpty(accessTokenPortion, ""),
objectSuffix);
}