@Override public Token fromString(String string) { if (string.length() % 2 == 1) string = "0" + string; return new AtlasBytesToken(Hex.hexToBytes(string)); } };
@Override public void validate(String token) throws ConfigurationException { try { if (token.length() % 2 == 1) token = "0" + token; Hex.hexToBytes(token); } catch (NumberFormatException e) { throw new ConfigurationException("Token " + token + " contains non-hex digits"); } }
case MD5: authenticated = MessageDigest.isEqual(FBUtilities.threadLocalMD5Digest().digest(password.getBytes()), Hex.hexToBytes(props.getProperty(username))); break; default:
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public static ByteBuffer hexToBytes(String str) { return ByteBuffer.wrap(Hex.hexToBytes(str)); }
public ByteBuffer fromString(String source) { try { return ByteBuffer.wrap(Hex.hexToBytes(source)); } catch (NumberFormatException e) { throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e); } }
public Token fromString(String string) { if (string.length() % 2 == 1) string = "0" + string; return new BytesToken(Hex.hexToBytes(string)); } };
public Token fromString(String string) { if (string.length() % 2 == 1) string = "0" + string; return new BytesToken(Hex.hexToBytes(string)); } };
public void validate(String token) throws ConfigurationException { try { if (token.length() % 2 == 1) token = "0" + token; Hex.hexToBytes(token); } catch (NumberFormatException e) { throw new ConfigurationException("Token " + token + " contains non-hex digits"); } }
public Token fromString(String string) { if (string.length() % 2 == 1) string = "0" + string; return new BytesToken(Hex.hexToBytes(string)); } };
public Token fromString(String string) { if (string.length() % 2 == 1) string = "0" + string; return new BytesToken(Hex.hexToBytes(string)); } };
public ByteBuffer fromString(String source) { try { return ByteBuffer.wrap(Hex.hexToBytes(source)); } catch (NumberFormatException e) { throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e); } }
public ByteBuffer fromString(String source) { try { return ByteBuffer.wrap(Hex.hexToBytes(source)); } catch (NumberFormatException e) { throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e); } }
public ByteBuffer fromString(String source) { try { return ByteBuffer.wrap(Hex.hexToBytes(source)); } catch (NumberFormatException e) { throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e); } }
public ByteBuffer fromString(String source) { try { return ByteBuffer.wrap(Hex.hexToBytes(source)); } catch (NumberFormatException e) { throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e); } }
private String base(String value) { try { byte[] bytes = Hex.hexToBytes(value.replaceFirst("0x", "")); return Hex.bytesToHex(bytes); } catch (NumberFormatException e) { throw new IndexException(e, "Field '{}' requires an hex string, but found '{}'", field, value); } } }