Browse | Submit A New Snippet | Create A Package

 

Criptografar

Type:
Function
Category:
Database Manipulation
License:
GNU General Public License
Language:
SQL
 
Description:
Função pra criptografar / descriptografar

Versions Of This Snippet::

LIDIA BAZANELLI
Snippet ID Download Version Date Posted Author Delete
37112008-06-06 16:58LIDIA BAZANELLI

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :1

function F_cripto(
  p_valor in varchar2 )
  return varchar2
is
  sCripto varchar2(100) := '';
  cChar   char(1);
  nAsc    number;
begin

  for i in 1..length(p_valor) loop       -- percorre toda a string recebida
    cChar   := substr( p_valor, i, 1 );  -- valor ASCII de cada caractere
    nAsc    := 255 - ascii( cChar );     -- valor ASCII invertido do caractere
    sCripto := sCripto || chr( nAsc );   -- adiciona caractere invertido à string de saída
  end loop;

  return( sCripto );

end F_cripto;
		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..