@Override public byte[] base32Decode( String data ) { return( Base32.decode( data )); }
@Override public String getTaggableID() { return( dl_identity==null?null:Base32.encode(dl_identity)); }
@Override public String toBase32String() { return Base32.encode(hash); } }
protected byte[] getRawPublicKey() { return( Base32.decode( public_key )); }
@Override public String base32Encode( byte[] data ) { return( Base32.encode( data )); }
protected void setUID( String str ) { uid = Base32.decode( str ); }
protected String getString() { return( "enabled=" + enabled + ",ip=" + ip + ",tcp=" + tcp_port + ",udp=" + udp_port + ",stat=" + online_status + ",key=" + (public_key==null?"<none>":Base32.encode( public_key ))); } }
private String decodeKey( String key ) { try{ return( new String( Base32.decode( key ),"UTF-8" )); }catch( Throwable e ){ Debug.out( e); return( "" ); } }
public String getString() { return( "title=" + title + ", ver=" + version + ", hash=" + (hash==null?"null":Base32.encode( hash )) + ", tracker=" + tracker +", date=" + date + ", sl=" + seeds_leechers + ", nets=" + nets ); } }
@Override public byte[] getHash() { String base32_hash = result.getHash(); if ( base32_hash != null ){ return( Base32.decode( base32_hash )); } return( null ); }
public static String getMagnetURI( byte[] hash ) { return( "magnet:?xt=urn:btih:" + Base32.encode( hash )); }
public boolean verifyPublicKey( String key ) { return( ecc_handler.verifyPublicKey( Base32.decode( key ))); }
@Override public String getID() { return( Base32.encode( key1 )); }
public static byte[] decodeSHA1Hash( String str ) { if ( str == null ){ return( null ); } str = str.trim(); byte[] hash = null; try{ if ( str.length() == 40 ){ hash = ByteFormatter.decodeString( str ); }else if ( str.length() == 32 ){ hash = Base32.decode( str ); } }catch( Throwable e ){ } if ( hash != null ){ if ( hash.length != 20 ){ hash = null; } } return( hash ); }
@Override public String getUID() { return( Base32.encode( uid )); }
public static void main( String[] args ) { try{ CoreFactory.create(); String short_id = ""; long res = getPopularityBySID( Base32.decode( short_id )); System.out.println( res ); }catch( Throwable e ){ e.printStackTrace(); } } }
@Override public String getHash() { byte[] hash = getByteArrayProperty( SearchResult.PR_HASH ); if ( hash == null ){ return( null ); } return( Base32.encode( hash )); }
@Override public Taggable resolveTaggable( String id ) { if ( id == null ){ return( null ); } return( getDownloadManager( new HashWrapper( Base32.decode( id )))); }
protected SubscriptionImpl getSubscriptionFromSID( byte[] sid ) { return (SubscriptionImpl) getSubscriptionByID( Base32.encode(sid)); }
public static byte[] getMapByteArray(Map map, String key, byte[] def) { if (map == null) { return def; } try { Object o = map.get(key); if (o instanceof byte[]) { return (byte[]) o; } String b64Key = key + ".B64"; if (map.containsKey(b64Key)) { o = map.get(b64Key); if (o instanceof String) { return Base64.decode((String) o); } } String b32Key = key + ".B32"; if (map.containsKey(b32Key)) { o = map.get(b32Key); if (o instanceof String) { return Base32.decode((String) o); } } return def; } catch (Throwable t) { Debug.out(t); return def; } }