Tabnine Logo
StringUtil.getAsciiBytes
Code IndexAdd Tabnine to your IDE (free)

How to use
getAsciiBytes
method
in
com.cloudhopper.commons.util.StringUtil

Best Java code snippets using com.cloudhopper.commons.util.StringUtil.getAsciiBytes (Showing top 6 results out of 315)

origin: com.cloudhopper/ch-commons-util

  private static Key getKey(String key) {
    try {
      byte[] bytes = StringUtil.getAsciiBytes(key);
      DESKeySpec pass = new DESKeySpec(bytes);
      SecretKeyFactory skf = SecretKeyFactory.getInstance("DES");
      SecretKey s = skf.generateSecret(pass);
      return s;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
}
origin: org.restcomm.smpp/ch-commons-util

  private static Key getKey(String key) {
    try {
      byte[] bytes = StringUtil.getAsciiBytes(key);
      DESKeySpec pass = new DESKeySpec(bytes);
      SecretKeyFactory skf = SecretKeyFactory.getInstance("DES");
      SecretKey s = skf.generateSecret(pass);
      return s;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
}
origin: com.cloudhopper/ch-commons-util

/**
 * Hashes the input String into a Base-64 encoded hashed String.
 * <ul>
 *  <li>MD5 - hash is always 24 char base-64
 *  <li>SHA1 - hash is always 28 char base-64
 *  <li>SHA256 - hash is always 44 char base-64
 *  <li>SHA512 - hash is always 88 char base-64
 * </ul>
 * @param string0 The String to hash. This assumes its an ASCII string.
 * @return The Base-64 encoded hashed String
 * @throws NoSuchAlgorithmException
 */
public String toHashedBase64String(String string0) throws NoSuchAlgorithmException {
  return this.toHashedBase64String(StringUtil.getAsciiBytes(string0));
}

origin: org.restcomm.smpp/ch-commons-util

/**
 * Hashes the input String into a Base-64 encoded hashed String.
 * <ul>
 *  <li>MD5 - hash is always 24 char base-64
 *  <li>SHA1 - hash is always 28 char base-64
 *  <li>SHA256 - hash is always 44 char base-64
 *  <li>SHA512 - hash is always 88 char base-64
 * </ul>
 * @param string0 The String to hash. This assumes its an ASCII string.
 * @return The Base-64 encoded hashed String
 * @throws NoSuchAlgorithmException
 */
public String toHashedBase64String(String string0) throws NoSuchAlgorithmException {
  return this.toHashedBase64String(StringUtil.getAsciiBytes(string0));
}

origin: org.restcomm.smpp/ch-commons-util

/**
 * Hashes the input String into a hex encoded hashed String.
 * <br>
 * <ul>
 *  <li>MD5 - hash is always 32 char hex string
 *  <li>SHA1 - hash is always 40 char hex string
 *  <li>SHA256 - hash is always 64 char hex string
 *  <li>SHA512 - hash is always 128 char hex string
 * </ul>
 * @param string0 The String to hash. This assumes its an ASCII string.
 * @return The hex encoded hashed String
 * @throws NoSuchAlgorithmException
 */
public String toHashedHexString(String string0) throws NoSuchAlgorithmException {
  return this.toHashedHexString(StringUtil.getAsciiBytes(string0));
}
origin: com.cloudhopper/ch-commons-util

/**
 * Hashes the input String into a hex encoded hashed String.
 * <br>
 * <ul>
 *  <li>MD5 - hash is always 32 char hex string
 *  <li>SHA1 - hash is always 40 char hex string
 *  <li>SHA256 - hash is always 64 char hex string
 *  <li>SHA512 - hash is always 128 char hex string
 * </ul>
 * @param string0 The String to hash. This assumes its an ASCII string.
 * @return The hex encoded hashed String
 * @throws NoSuchAlgorithmException
 */
public String toHashedHexString(String string0) throws NoSuchAlgorithmException {
  return this.toHashedHexString(StringUtil.getAsciiBytes(string0));
}
com.cloudhopper.commons.utilStringUtilgetAsciiBytes

Javadoc

Get 7-bit ASCII character array from input String. The lower 7 bits of each character in the input string is assumed to be the ASCII character value. Hexadecimal - Character | 00 NUL| 01 SOH| 02 STX| 03 ETX| 04 EOT| 05 ENQ| 06 ACK| 07 BEL| | 08 BS | 09 HT | 0A NL | 0B VT | 0C NP | 0D CR | 0E SO | 0F SI | | 10 DLE| 11 DC1| 12 DC2| 13 DC3| 14 DC4| 15 NAK| 16 SYN| 17 ETB| | 18 CAN| 19 EM | 1A SUB| 1B ESC| 1C FS | 1D GS | 1E RS | 1F US | | 20 SP | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | | 28 ( | 29 ) | 2A * | 2B + | 2C , | 2D - | 2E . | 2F / | | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | | 38 8 | 39 9 | 3A : | 3B ; | 3C < | 3D = | 3E > | 3F ? | | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4A J | 4B K | 4C L | 4D M | 4E N | 4F O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5A Z | 5B [ | 5C \ | 5D ] | 5E ^ | 5F _ | | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6A j | 6B k | 6C l | 6D m | 6E n | 6F o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | | 78 x | 79 y | 7A z | 7B { | 7C | | 7D } | 7E ~ | 7F DEL|

Popular methods of StringUtil

  • isEmpty
    Checks if the string is an empty value which is true if the string is null or if the string represen
  • substituteWithProperties
    Searches string for occurrences of a pattern, extracts out a key name between the startStr and endSt
  • toStringWithNullAsEmpty
    Returns the value from calling "toString()" on the object, but is a safe version that gracefully han
  • SQLToUpperCase
    Convert string to uppercase Always use the java.util.ENGLISH locale
  • capitalize
    Safely capitalizes a string by converting the first character to upper case. Handles null, empty, an
  • compressQuotes
    Compress 2 adjacent (single or double) quotes into a single (s or d) quote when found in the middle
  • containsOnlyDigits
    Checks if a string contains only digits.
  • getAsciiString
  • indexOf
    Finds the first occurrence of the targetString in the array of strings. Returns -1 if an occurrence
  • isEqual
    Checks if both strings are equal to each other. Safely handles the case where either string may be n
  • isPrintableChar
    Return true if the character is printable in ASCII. Not using Character.isLetterOrDigit(); applies t
  • isSafeChar
    Returns true if the char is considered a "safe" char. Please see documentation for isSafeString().
  • isPrintableChar,
  • isSafeChar,
  • quoteString,
  • readToString,
  • substituteWithEnvironment

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now