title: How Do I convert bytes to ASCII chars, using Oracle PL/SQL
body: <p>I have a problem with conversion this bytes to ASCII chars, need to do similar conversion using Oracle PL/SQL, the original one is in MS SQLserver:
   </p>
  
  <pre><code>   /// &lt;/summary&gt; 
  
  /// &lt;param name="blob"&gt;&lt;/param&gt;
  
  /// &lt;returns&gt;&lt;/returns&gt; 
  
  [Microsoft.SqlServer.Server.SqlFunction(IsDeterministic = true, IsPrecise = true)] 
  
  public static String VarbinaryToVarchar(SqlBytes blob) 
  { 
      if (blob.IsNull) return null; 
  
      byte[] buffer = blob.Buffer; 
      char[] res = new char[buffer.Length * 2]; 
      for (int i = 0; i &lt; buffer.Length; i++) 
      { 
          res[i * 2] = (char)((buffer[i] &amp; 0xF) + 65); 
          res[i * 2 + 1] = (char)(((buffer[i] &gt;&gt; 4) &amp; 0xF) + 65); 
      } 
      return new String(res); 
  } 
  </code></pre>
  
  <p>Thanks in advance guys!</p>