public byte[] encode(byte[] arg0) throws EncoderException { return encodeBase32(arg0); }
public byte[] encode(byte[] arg0) throws EncoderException { return encodeBase32(arg0); }
public byte[] encode(byte[] arg0) throws EncoderException { return encodeBase32(arg0); }
public byte[] encode(byte[] arg0) throws EncoderException { return encodeBase32(arg0); }
public byte[] encode(byte[] arg0) throws EncoderException { return encodeBase32(arg0); }
public Object encode(Object object) throws EncoderException { if (!(object instanceof byte[])) { throw new EncoderException( "Parameter supplied to Base32 encode is not a byte[]"); } return encodeBase32((byte[]) object); } }
public Object encode(Object object) throws EncoderException { if (!(object instanceof byte[])) { throw new EncoderException( "Parameter supplied to Base32 encode is not a byte[]"); } return encodeBase32((byte[]) object); } }
public String getLockedDomainPrefix(String token) { byte[] sha = GenericDigestUtils.digest(token); return new String(Base32.encodeBase32(sha)); // a hash } }
public Object encode(Object object) throws EncoderException { if (!(object instanceof byte[])) { throw new EncoderException( "Parameter supplied to Base32 encode is not a byte[]"); } return encodeBase32((byte[]) object); } }
public Object encode(Object object) throws EncoderException { if (!(object instanceof byte[])) { throw new EncoderException( "Parameter supplied to Base32 encode is not a byte[]"); } return encodeBase32((byte[]) object); } }
public Object encode(Object object) throws EncoderException { if (!(object instanceof byte[])) { throw new EncoderException( "Parameter supplied to Base32 encode is not a byte[]"); } return encodeBase32((byte[]) object); } }
/** * Calculate hash value for response and update metadata value (DATA_HASH) * @return hash value */ public String getHash(HttpResponse response) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(response.getResponseAsBytes()); byte[] md5val = md5.digest(); return new String(Base32.encodeBase32(md5val), "UTF-8"); } catch (NoSuchAlgorithmException e) { // Should not happen LOG.info("Error getting MD5 digest, ignored"); } catch (UnsupportedEncodingException e) { // Should not happen LOG.info("Error parsing MD5 string as UTF8"); } return null; }
/** * Calculate hash value for response and update metadata value (DATA_HASH) * @return hash value */ public String getHash(HttpResponse response) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(response.getResponseAsBytes()); byte[] md5val = md5.digest(); return new String(Base32.encodeBase32(md5val), "UTF-8"); } catch (NoSuchAlgorithmException e) { // Should not happen LOG.info("Error getting MD5 digest, ignored"); } catch (UnsupportedEncodingException e) { // Should not happen LOG.info("Error parsing MD5 string as UTF8"); } return null; }
public String getLockedDomainPrefix(Uri gadgetUri) { byte[] sha1 = DigestUtils.sha(gadgetUri.toString()); return new String(Base32.encodeBase32(sha1)); // a hash } }
public String getLockedDomainPrefix(Uri gadgetUri) { byte[] sha1 = DigestUtils.sha(gadgetUri.toString()); return new String(Base32.encodeBase32(sha1)); // a hash } }
/** * Calculate hash value for response and update metadata value (DATA_HASH) * @return hash value */ public String getHash(HttpResponse response) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(response.getResponseAsBytes()); byte[] md5val = md5.digest(); return CharsetUtil.newUtf8String(Base32.encodeBase32(md5val)); } catch (NoSuchAlgorithmException e) { // Should not happen if (LOG.isLoggable(Level.INFO)) { LOG.logp(Level.INFO, classname, "getHash", MessageKeys.ERROR_GETTING_MD5); } } return null; }
private String getLockedDomain(Gadget gadget, String container) { String suffix = lockedSuffixes.get(container); if (suffix == null) { return null; } byte[] sha1 = DigestUtils.sha(gadget.getSpec().getUrl().toString()); String hash = new String(Base32.encodeBase32(sha1)); return hash + suffix; }
private String getLockedDomain(Gadget gadget, String container) { String suffix = lockedSuffixes.get(container); if (suffix == null) { return null; } byte[] sha1 = DigestUtils.sha(gadget.getSpec().getUrl().toString()); String hash = new String(Base32.encodeBase32(sha1)); return hash + suffix; }