本文整理汇总了Java中com.helger.commons.string.StringHelper.getHexEncoded方法的典型用法代码示例。如果您正苦于以下问题:Java StringHelper.getHexEncoded方法的具体用法?Java StringHelper.getHexEncoded怎么用?Java StringHelper.getHexEncoded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.string.StringHelper
的用法示例。
在下文中一共展示了StringHelper.getHexEncoded方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Override
public String toString ()
{
if (m_sIndentationStringToString == null)
m_sIndentationStringToString = StringHelper.getHexEncoded (m_sIndentationString.getBytes (StandardCharsets.ISO_8859_1));
return new ToStringGenerator (this).append ("xmlVersion", m_eXMLVersion)
.append ("serializeXMLDecl", m_eSerializeXMLDecl)
.append ("serializeDocType", m_eSerializeDocType)
.append ("serializeComments", m_eSerializeComments)
.append ("indent", m_eIndent)
.append ("indentDeterminator", m_aIndentDeterminator)
.append ("incorrectCharHandling", m_eIncorrectCharacterHandling)
.append ("charset", m_aCharset)
.append ("namespaceContext", m_aNamespaceContext)
.append ("doubleQuotesForAttrs", m_bUseDoubleQuotesForAttributes)
.append ("bracketModeDeterminator", m_aBracketModeDeterminator)
.append ("spaceOnSelfClosedElement", m_bSpaceOnSelfClosedElement)
.append ("newlineMode", m_eNewLineMode)
.append ("indentationString", m_sIndentationStringToString)
.append ("emitNamespaces", m_bEmitNamespaces)
.append ("putNamespaceContextPrefixesInRoot",
m_bPutNamespaceContextPrefixesInRoot)
.getToString ();
}
示例2: generateNewTokenID
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public static String generateNewTokenID (@Nonnegative final int nBytes)
{
final byte [] aID = new byte [nBytes];
RandomHelper.getRandom ().nextBytes (aID);
return StringHelper.getHexEncoded (aID);
}
示例3: getHexEncodedDigestString
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* @return The hex-encoded String of the message digest bytes. Never
* <code>null</code>.
*/
@Nonnull
@Nonempty
public String getHexEncodedDigestString ()
{
return StringHelper.getHexEncoded (m_aDigestBytes);
}
示例4: createPasswordHash
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Nonnull
public String createPasswordHash (@Nonnull final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword)
{
ValueEnforcer.notNull (aSalt, "Salt");
ValueEnforcer.notNull (sPlainTextPassword, "PlainTextPassword");
final byte [] aDigest = pbkdf2 (sPlainTextPassword.toCharArray (),
aSalt.getSaltBytes (),
m_nIterations,
m_nHashBytes);
return StringHelper.getHexEncoded (aDigest);
}
示例5: PasswordSalt
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Constructor to create a new password salt with the provided byte count.
*
* @param nSaltBytes
* The number of salt bytes to use. Must be > 0.
*/
public PasswordSalt (@Nonnegative final int nSaltBytes)
{
ValueEnforcer.isGT0 (nSaltBytes, "SaltBytes");
m_aBytes = new byte [nSaltBytes];
RandomHelper.getRandom ().nextBytes (m_aBytes);
m_sSalt = StringHelper.getHexEncoded (m_aBytes);
}